【发布时间】:2018-04-10 22:04:57
【问题描述】:
我有一个错误:"ExceptionMessage": "Self referencing loop detected for property 'Posto' with type 'UfficioServer.Posto'. Path '[0].Dipendente[0]'.",
当我调用我的 web api 时,我需要一个与 Dipendente 关联的 Posti 列表...
public List<Posto> GetAllPosti()
{
try
{
List<Posto> p = new List<Posto>();
UfficioPostiEntities1 db = new UfficioPostiEntities1();
db.Configuration.ProxyCreationEnabled = false;
var posto = db.Posto.Include("Dipendente").ToList();
var x = db.Posto.ToList();
return x;
}
有人可以帮助我吗?
【问题讨论】:
标签: entity-framework asp.net-core-webapi