BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Named Resource Streams for WCF Data Services

Named Resource Streams for WCF Data Services

Bookmarks

Originally known as Astoria and released under the name ADO.NET Data Services, WCF Data Services is a REST-style framework for exposing and querying structured data. The results can be returned as plain XML, JSON or RDF+XML. The overall protocol is known as OData and has been released under Microsoft’s Open Specification Promise.

Under the current version of WCF Data Services, developers can associate only one streaming resource with a given entity. A typical use for this would be an entity describing an image or video and the image/video file itself. Obviously this has some limitations when one want to expose multiple versions of the same resource without duplicating the entity data.

With the October 2010 CTP, developers can now add additional named streams to an entity. For example, for images you may have streams named “Thumbnail”, “Small”, and “Full”. The list of named streams is defined at the meta-data level, which means each instance of entity has the same named list.

In addition to specifying the list of named streams, the method of which depends on how the entities are defined, once must also implement the IDataServiceStreamProvider2 interface. The process for implementing this interface is essentially the same as the original version. For more information see the WCF Data Services blog.

Rate this Article

Adoption
Style

BT