Reacting to EF: Setting Identity as ValueGenerationStrategy explicitly

This commit is contained in:
Smit Patel 2015-03-20 17:39:02 -07:00
parent b66b2df264
commit ad009c05d6
1 changed files with 5 additions and 0 deletions

View File

@ -28,5 +28,10 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
{ }
public DbSet<Blog> Blogs { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Blog>().Property(e => e.BlogId).ForSqlServer().UseIdentity();
}
}
}