Media Link Entry in WCF Services RRS feed

  • Question

  • For reading BLOBS in a OData Service, I am using the DataServiceContext.GetReadStream() The GetReadStream method synchronously requests a data stream that contains the binary property of the requested entity.

    In the AtomPub protocol, the entity is a Media Link Entry and the binary property is the associated Media Resource.

    In the code I am using the proxy generated using Datasvcutil.exe. The proxy generates many classes for the entities. Is there any property to detect whether the given entity has binary stream or not.

    Currently I call dataSvcContext.GetReadStream(customer) and getting ArgumentException for an entity that does not have Media Link property or binary property.

    Is there any method available to detect whether entity has binary property or not?

    Thursday, September 9, 2010 3:54 PM


All replies

  • Hi,

    Are you using WCF Data service or WCF services?


    Monday, September 13, 2010 9:16 AM
  • Hello,

    For entity types which have a MLE , the code gen will put a [HasStream] attribute on the CLR class definition for the entity type.

    Hope this helps,

    Monica Frintu

    Monday, September 13, 2010 8:36 PM
  • Hi

    I am using WCF Data Services.




    Tuesday, September 14, 2010 11:12 AM
  • Hello,


    Thanks. That is what I was looking for. If there is HasStream attribute at the EntityLevel, that would be sufficient to detect the presence of MLE.



    Tuesday, September 14, 2010 11:13 AM