Linq IRepository

edit

Linq IRepository

Summary

For testability, SubSonic 3.0 now includes an IRepository interface that you can extend via T4 Templates. The Repository is pretty straightforward:
public interface IRepository { IQueryable GetAll(); PagedList GetPaged(Expression> orderBy, int pageIndex, int pageSize); IQueryable Find(Expression> expression); void Add(T item); int Update(T item); int Delete(T item); int Delete(object key); int Delete(Expression> expression); T GetByKey(object key); } This interface is implemented in SubSonic.Core.dll. You will find this interface as well as an implementation - SubSonicRepository - in the SubSonic.Repository namespace.