I have a [User] table, and a [UserSettings] table. Both are keyed on an ID column. There is a foreign key from UserSettings.Id to User.Id.
I imported this SQL Server database using LLBLGEN Pro it correctly generated a one-one relationship.
When I retrieve a User from the DataContext and set myUser.Settings = new UserSettings() and then call UpdateDatabase, the UserSettings instance is not saved.
I am wondering. When my ModelBuilder is generated (C#, EntityFrameworkCore) there is no config.Property definition for User to UserSettings, only from UserSettings to User, so I added this
config.HasOne(t => t.Settings).WithOne(t => t.User);
The DataContext.ChangeTracker shows only 1 entity (User) with a state of Unchanged.
Is this an EntityFrameworkCore bug, or do I need to ensure the ModelBuilder class defines the user differently to the attempt I made above?
Thanks