Named Resource Streams for WCF Data Services
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.
Sarah Howe Jul 06, 2015