开发者

Success with WCF Data Services (OData) with NHibernate?

I'm working on a CQRS-style system with commands processed with NSericeBus and queries provided through a read-only OData feed.

We would like to have the WCF Data Services feed backed by NHibernate so we can have control over how our data appears in the feed (calculated fields, etc), which the Entity Framework provider does not allow.

However, using the reflection provider with Linq to NHibernate, we are getting errors when we navigate 开发者_Python百科to related entities (e.g, http://server/feed/Foo(1)/Bar).

Has anyone made a Linq to NHibernate backed WCF Data Service work?


How do you mean, you want to do something that the Entity Framework does not allow?

If you need calculated fields, you can define a View in your DB (SQL Server?) with calculated fields, and incorporate that View into your read-only Entity Model.

If you need to pre-calculate the fields, you can simply do that in your denormalizer code.

What scenario do you need that you cannot do with EF?


Most like what you're looking for is NHibernate.OData. This allows you to take the passed in odata and have NHibernate auto-convert it to a DetachedCriteria instance.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜