Search code examples
wcf-data-servicesodata

Using MimeType attribute for more OData operations


The MimeTypeAttribute is defined as AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple = false, Inherited = true) so you cannot use it more than once on a class. But what if I want in my OData service to specify MIME type for more than one operation? How to do it?


Solution

  • This is a known issue in WCF Data services that we are looking into fixing in the next round of release. For now, if you are using the custom provider, you can set the mime type explicitly in the metadata API.