How to: Create a Data Service Using the Reflection Provider (WCF Data Services)
WCF Data Services enables you to define a data model that is based on arbitrary classes as long as those classes are exposed as objects that implement the IQueryable<T> interface. For more information, see Data Services Providers.
The following example defines a data model that includes
Items. The entity container class
OrderItemData has two public methods that return IQueryable<T> interfaces. These interfaces are the entity sets of the
Items entity types. An
Order can include multiple
Items, so the
Orders entity type has an
Items navigation property that returns a collection of
Items objects. The
OrderItemData entity container class is the generic type of the DataService<T> class from which the
OrderItems data service is derived.
Because this example demonstrates an in-memory data provider and changes are not persisted outside of the current object instances, there is no benefit derived from implementing the IUpdatable interface. For an example that implements the IUpdatable interface, see How to: Create a Data Service Using a LINQ to SQL Data Source.
[!CODE [Astoria Reflection Provider#CustomIQueryable](../CodeSnippet/VS_Snippets_Misc/astoria reflection provider#customiqueryable)]