entity framework core foreign key different column name code example

entity framework core foreign key different column name

1

1 Example

0
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{

    modelBuilder.Entity<WidgetEntity>()
     .HasRequired(w => w.Sequence)
     .WithMany()
     .Map(m => m.MapKey("WIDGETSEQUENCE_ID"));
}
by on

Other Code Examples