ASP.NET 4 MVC Web API: Serialization of an interface to XML

AKHIL_8282

New Member
I manage my objects with a IoC-container (autofac). Because of that I only use interfaces instead of objects.If my web api returns a object of type "Document" the framework can handle json and xml serialization.I added [DataContract]-Attributes to the Document-class, but in a interface this is no possible.So if i want to return a object of type IDocument, i get a HTTP-code 500.ASP.NET 4 MVC Web API is now RC, can the framework still not serialize interface member into xml?Json serialization is no problem.
 
Back
Top