I was studying the Oxite project on Codeplex. It has repository interfaces, and an implementation using LINQ to SQL. The LINQ to SQL results are projected to POCO objects in the repository implementations. It looks something like:
public IQueryable<Post> GetPosts() { return projectPosts(excludeNotYetPublished(getPostsQuery(siteID))); }
This is an interesting pattern, so I wondered if it has a specific name.
Thanks!
Data Mapper. See it mentioned here http://www.martinfowler.com/eaaCatalog/repository.html
‘In such systems it can be worthwhile to build another layer of abstraction over the mapping layer where query construction code is concentrated’.
Note that there are different views on this. I would say those that subscribe to doing that, claim the linq2sql classes are specific to the data access technology, so I guess they see it as an implementation detail of the repository.
Perhaps you mean to ask for a name on the ‘repository’ that returns an IQueryable. I don’t think there is a commonly agreed name for that one. Rob Connery used this one on his asp.net mvc storefront series: http://blog.wekeroad.com/mvc-storefront. If you look at the old blog posts on it, you can see calling a repository is actually controversial.