self referencing loop detected for propert with type System.data.entity.dynamic.proxiesOccurs when trying to serialize the EF object collection directly.Some ways correcting:
Add to the db context constructor:
Configuration.ProxyCreationEnabled = false;
Or (better way),
HttpConfiguration config = GlobalConfiguration.Configuration;
config.Formatters.JsonFormatter
.SerializerSettings
.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore
Other ways of correcting found at Stackoverflow
This post is for the purpose of my notes only and sometimes a rant.
“I invented nothing new. I simply assembled the discoveries of other men behind whom were centuries of work. Had I worked fifty or ten or even five years before, I would have failed. So it is with every new thing. Progress happens when all the factors that make for it are ready and then it is inevitable. To teach that a comparatively few men are responsible for the greatest forward steps of mankind is the worst sort of nonsense.”Henry Ford