0

Im working on a webapi project with EF and and sqlserver. Now when I trying to get for ex IEnumerable its works and show me all employees on xml file .(Employee dont have foreign key only primary). when I ask other controller for ex IEnumerable its give me the

The 'ObjectContent`1' type failed to serialize the response body for content type 'application/xml; charset=utf-8'

Error. any Suggestions?

GuidoG
  • 11,359
  • 6
  • 44
  • 79
Igal
  • 1
  • 2

1 Answers1

0

ok thank for help actually already saw those topics but missed a part there,any way i just added those lines:

this.Configuration.LazyLoadingEnabled = false;

this.Configuration.ProxyCreationEnabled = false;

in the dbContext ctor and it worked. now try to understand what those line are

Igal
  • 1
  • 2