BT

Named Resource Streams for WCF Data Services

by Jonathan Allen on Nov 25, 2010 |

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.

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT