-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Circular References #4646
Copy link
Copy link
Closed as not planned
Description
My model is effectively:
public class Project
{
[Key]
public Guid ProjectId { get; set; }
public Guid ClientId { get; set; }
public virtual Client Client { get; set; }
}
public class Client
{
[Key]
public Guid ClientId { get; set; }
public virtual ICollection<Project> Projects { get; set; } = new List<Project>();
}
Up until I changed to the EntityFrameworkCore, I could fetch Projects with their associated Clients:
DbContext.Projects.Include(p => p.Client);
Since upgrading, I'm getting the error:
Additional information: Self referencing loop detected with type 'Models.Project'. Path 'Client.Projects'.
This should be pretty straight-forward: give me the Projects and their Clients. I don't want the Clients' Projects - else then I could see the issue with the loop.
I've mentioned this here:
aspnet/Mvc#4160
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.