I have the fowling models:
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; }
}
When I use Web Api by generating an EF scaffolding API controller, it didn't work. The error is below:
Self referencing loop detected for property 'Order' with type
'System.Data.Entity.DynamicProxies.Order_A97AC61AD05BA6A886755C779FD3F96E86FE903ED7C9BA9400E79162C11BA719'.
Path '[0].Order[0]'
Can anyone help me solve the problem?