自定义Data Service Providers

WCF Data Service的下面是Data Service,负责与数据源进行交互,Data Service附带了一个内部框架,可以让你自定义数据服务提供者。WCF Data Service默认使用的是Entity Framework,还有一个Reflection Provider,可以支持只读的数据服务,如果需要可读写的数据服务,需要实现接口IUpdatable,可以参照Linq To SQL的Provider:ADO.NET Data Services IUpdateable implementation for Linq to Sql

自定义Data Service Providers需要做大量的工作,具体怎么做请参看Meta-Me的系列文章。

Part 1 – Intro
Part 2 – IServiceProvider and DataSources
Part 3 – IDataServiceMetadataProvider
Part 4 – Minimal Running Service
Part 5 – Query
Part 6 – Query Interactions
Part 7 – Updates

Part 8 - Relationships

http://weblogs.asp.net/cibrax/archive/2010/03/15/odata-to-the-rescue-exposing-the-eventlog-as-a-data-feed.aspx

NHibernating a WCF Data Service

http://weblogs.asp.net/cibrax/archive/2010/08/13/nhibernating-a-wcf-data-service.aspx

http://msdn.microsoft.com/zh-cn/library/dd672591.aspx

原文地址:https://www.cnblogs.com/Leo_wl/p/1802917.html