When double quote characters are added to a table name they aren't properly escaped in generated migrations code
Adding this block of code:
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<Entity>().ToTable("\"table\"");
}
to a model causes an invalid migration to be generated
public override void Up()
{
CreateTable(
"dbo."table"",
c => new
{
ID = c.Int(nullable: false, identity: true),
Title = c.String(),
Author = c.String(),
Timestamp = c.DateTime(nullable: false),
})
.PrimaryKey(t => t.ID);
}
Adding this block of code:
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<Entity>().ToTable("\"table\"");
}
to a model causes an invalid migration to be generated
public override void Up()
{
CreateTable(
"dbo."table"",
c => new
{
ID = c.Int(nullable: false, identity: true),
Title = c.String(),
Author = c.String(),
Timestamp = c.DateTime(nullable: false),
})
.PrimaryKey(t => t.ID);
}