Reacting to EF: Setting Identity as ValueGenerationStrategy explicitly
This commit is contained in:
parent
b66b2df264
commit
ad009c05d6
|
|
@ -28,5 +28,10 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
public DbSet<Blog> Blogs { get; set; }
|
public DbSet<Blog> Blogs { get; set; }
|
||||||
|
|
||||||
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
modelBuilder.Entity<Blog>().Property(e => e.BlogId).ForSqlServer().UseIdentity();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue