I\'m sorry for the repetition. I\'m heading with a same problem but still could not handle it. I\'m using Angularjs framework and Asp.net mvc.
My person class:
The problem is solved. I get help from my friend. Its about unclosed connection. Its my fault. I didn't mention it.
In PersonIndexVM()
, I created People = new List
Person class is created by entity framework. It is related with database. When I create a model
that is an object of PersonIndexVM()
in GetPeople()
method and return this model
object as a json, model object try to reach User class informations after the connection closed. And I'm getting this error. To solve this problem:
Closing the lazy loading to prevent reaching User information. dc.Configuration.LazyLoadingEnabled = false;
Creating another class not related with database and return its object as Json.