Should a Repository return IEnumerable<T> , IQueryable<T> or List<T>?
问题 I'd like to make my application as flexible as possible, but not dig myself into a hole by making my Interface too specific. What is the best object type for a repository? IEnumerable, IQueryable, or List? The technologies I'm considering using are Azure App Fabric Caching Entity Framework 4.1 Possibly Windows Server AppFabric 回答1: I would say build your DAL using IQueryable, and pass it around, make sure your object contects lifetime is the request. This way you will get benefit of delayed