开发者

OData EndPoint/DataService Using IEnumerable<IQueryable>

开发者 https://www.devze.com 2022-12-29 19:50 出处:网络
I am using NHibernate with NHibernate.Linq, and have a bunch of dynamically loading modules each with their own POCO\'s and Mappings (ClassMap<POCO>).

I am using NHibernate with NHibernate.Linq, and have a bunch of dynamically loading modules each with their own POCO's and Mappings (ClassMap<POCO>).

I have created OData services before, but normally with a datacontext and IQueryable as Properties/Getters.

What I want is to create the service by passing in IEnumerable, into the constructor

IEnumera开发者_JS百科ble<IQueryable>> queryableObjects;
var dataService = new DataService(queryableObjects);

Is this at all possible?


It is doable, but it requires some more work. The way to do this is to implement your customer provider. A very nice guide how to do this is here: https://blogs.msdn.microsoft.com/alexj/2010/01/07/custom-data-service-providers/

There are also nice samples as part of the OData provider toolkit, which can be found on OData SDK - Sample Code.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号