tabs ↹ over ␣ ␣ ␣ spaces

by Jiří {x2} Činčura

Multiple MimeType attribute for OData service

12 Nov 2012 1 mins OData/Data Services (Astoria)

I was recently doing my course on Entity Framework (drop me a line, if you’re interested) and the last day we were diving into WCF Data Services aka OData.

There’s a MimeType attribute that allows you, simply speaking, set the MIME type for the output of some operation. That’s great, because you can immediately provide i.e. text/html output where the HTML is saved in come column in database. But it’s a fair need to want to specify the MIME type for operations you have. Sadly the MimeType attribute has to be on class and has AllowMultiple = false. Bummer.

After some poking around, research etc. I found that there’s indeed a limitation that you currently cannot specify the MIME type for more than one operation. But good news is, that in future release(s) this limitation should be lifted.

Wondering how’s possible I never thought about this myself before??? 😃

Profile Picture Jiří Činčura is .NET, C# and Firebird expert. He focuses on data and business layers, language constructs, parallelism, databases and performance. For almost two decades he contributes to open-source, i.e. FirebirdClient. He works as a senior software engineer for Microsoft. Frequent speaker and blogger at www.tabsoverspaces.com.