我有一个存储库类,它包装了我的LINQ to SQL数据上下文.存储库类是一个业务线类,包含所有数据层逻辑(以及缓存等).
这是我的repo界面的v1.
public interface ILocationRepository
{
IList<Location> FindAll();
IList<Location> FindForState(State state);
IList<Location> FindForPostCode(string postCode);
}
Run Code Online (Sandbox Code Playgroud)
但是为了处理FindAll的分页,我正在讨论是否要公开IQueryable <ILocation>而不是IList来简化分页等环境的接口.
从数据仓库中暴露IQueryable的利弊是什么?
很感谢任何形式的帮助.