IQueryable and IEnumerable
The IQueryable interface is too broad. Its intention is to allow any LINQ expression to be translated into SQL, which is an impossible task. It is misleading to use the IQueryable interface as part of the public API. It should be maintained within the repository and the list converted to IEnumerable.
In the collections, IEnumerable is the most generic collection. And the IReadOnlyList, Array and IList are the most specific.
Comments
Post a Comment