Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Created Unassigned: " characters in Table names generate invalid migrations [1199]

$
0
0
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);

}


Viewing all articles
Browse latest Browse all 10318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>