class Business- ...- Address Address { get; set; }class Address- ...- Business { get; set; }
class Business- ...- Address Address { get; set; }class Address- ...- Business { get; set; }
InvalidOperationException: The value of 'Address.Id' is unknown when attempting to save changes. This is because the property is also part of a foreign key for which the principal entity in the relationship is not known
InvalidOperationException: The value of 'Address.Id' is unknown when attempting to save changes. This is because the property is also part of a foreign key for which the principal entity in the relationship is not known
Initialization code:
var address = new Address { Street = "SName", City = "CName", }; await dbContext.Addresses.AddAsync(address);
var address = new Address { Street = "SName", City = "CName", }; await dbContext.Addresses.AddAsync(address);
How can I make this work while also keeping Address' nav property to Business? Please @ me so I respond immediately