When I add an a new entity to a table I would want to populate the navigation properties after saving the changes. How would I do this?
Here's what I'm doing now, and the navigation property Condition is null. I have checked that the foreign key has been set. I also tried just assigning to the nav property manually by reading from the other table directly but even that did not work.
...
var group = _context.Groups.AddRange(groups).First();
await _context.SaveChangesAsync();
// group.Condition which is a navigation property is null after this.
// The property does work when I get the group from the context, after adding.
var group = _context.Groups.AddRange(groups).First().Include(x=>x.Condition);