我有打鸟模型:
public class Order
{
public int OrderId { get; set; }
//
public virtual ICollection<Client> Clients { get; set; }
}
public class Client
{
public int ClientId { get; set; }
public string ClientName { get; set; }
public virtual Order Order { get; set; }
}
当我通过生成 EF 脚手架 API 控制器来使用 Web Api 时,它不起作用。错误如下:
Self referencing loop detected for property 'Order' with type
'System.Data.Entity.DynamicProxies.Order_A97AC61AD05BA6A886755C779FD3F96E86FE903ED7C9BA9400E79162C11BA719'.
Path '[0].Order[0]'
谁能帮我解决问题?