开发者

WCF Data Services with Custom Entities

I have a set of custom entities which reflect the business representation of data. Then I also have a set of entities that map 1-to-1 to the database that represent the storage of the data. My business layer converts between the 2 types and performs any other logic needed. I on开发者_JAVA技巧ly expose the custom objects through my service interface.

From what I can tell I cannot use WCF Data Services. Data services

  1. need to be bound directly to a db source (or some slight abstraction of the direct db connection) and,
  2. that results in using the data entities.

Correct me if I'm wrong, but I can't see any way to use WCF Data Services and its built-in queryability with custom entities while using my business layer.


I do not necessarily agree with that. If you look at the Architecture Overview in http://msdn.microsoft.com/en-us/library/cc668794.aspx you see two other options next to the EF / DB connectivity. You can have Data Service Providers that just take an alternative (your custom) information model made up of queryable CLR classes and expose them using WCF data services.

So if you create your Business Layer using this approach, your custom entities can just as easy be exposed with WCF data services.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜