RobThree / MongoRepository

Repository abstraction layer on top of Official MongoDB C# driver
https://www.nuget.org/packages/MongoRepository/
MIT License
307 stars 141 forks source link

json serialization issue ASP.Net Web api #14

Closed gdefombelle closed 9 years ago

gdefombelle commented 9 years ago

When returning an entity object (derived from Entity) from a Web method, only the Id property is retuned; all other properties of the object are ignored in Json format (xml is ok) I use ASP.Net Web Api Controller Class v2.1 a work araound is to set the [DataMemberAttribute] to each property to export in Json

RobThree commented 9 years ago

See https://github.com/RobThree/MongoRepository/issues/6 please. Also: there's no actual question in this issue? The 'workaround' you present works for your case specifically (and is, as far as I can 'guess' from this issue, as-intended) but others may require other attributes or even totally different solutions.