Using code-first with Entity Framework 6.
I've this entity:
public class LineSection
{
public int Id { get; set; }
public List<LineSection> Next { get; set; }
public List<LineSection> Previous { get; set; }
}
I add a migration, just to see how the database will be:
CreateTable(
"dbo.LineSectionLineSections",
c => new
{
LineSection_Id = c.Int(nullable: false),
LineSection_Id1 = c.Int(nullable: false),
})
.PrimaryKey(t => new { t.LineSection_Id, t.LineSection_Id1 })
.ForeignKey("dbo.LineSections", t => t.LineSection_Id)
.ForeignKey("dbo.LineSections", t => t.LineSection_Id1)
.Index(t => t.LineSection_Id)
.Index(t => t.LineSection_Id1);
I don't like the default naming. Can I change the tablename (LineSectionLineSections) and the two foreignkeys (LineSection_Id and LineSection_Id1). Using modelbuilder, data attributes or some other way?