So, what can you find in the new System.Data.Services.Providers namespace, and why would you care?
Typically, you’ll write data services using a well-defined data model with rich querying and update capabilities, like the Entity Framework. In this case, you won’t care much for the types in this namespace.
If on the other hand you have something quite different and you want to make it “look like” a regular data service on the wire, you pretty have much two options. First, use the Reflection Provider, where the data service infers information from your IQueryable properties. Second, take over more of the work and provide deeper customization, implementing some of the interfaces in this namespace.
The types here really address the following:
- Interfaces used to make your data look like a fully-featured data service source.
- IDataServiceMetadataProvider to provide custom metadata rather than auto-discovered.
- IDataServiceQueryProvider to support for custom query providers.
- IDataServiceUpdateProvider, a more specialized version of IUpdatable that also allows custom etag handling.
- IDataServicePagingProvider to support custom paging strategies.
- IDataServiceStreamProvider to support streaming binary data.
- Types used to describe the data model.
- ResourceType, ResourceProperty: types and their properties
- ResourceSet: sets where instances live.
- ResourceAssociationSet and ResourceAssociationSetEnd, to describe associations
- ResourcePropertyKind and ResourceTypeKind enums, to support the above.
- Types used to describe service operations.
- ServiceOperation, ServiceOperationParameter and ServiceOperationResultKind.
- Types used to hold methods that are used for late-bound methods.
- DataServiceProviderMethods and OpenTypeMethods. More on these on a later post, but really these are only interesting if you’re writing a custom query provider that doesn’t rely on specific CLR types for your data.