That worked and made the field nullable in the generated code. However, the nav prop in the context class was incorrect.
GENERATED:
Code: Select all
modelBuilder.Entity<State>().HasOne(x => x.State).WithMany().HasForeignKey(@"StateId");
Code: Select all
modelBuilder.Entity<State>().HasOne(x => x.State).WithMany().IsRequired(false).HasForeignKey(@"StateId");
IsRequired(bool required = true)