Example #1
0
 public void MapItem(List <Item> items)
 {
     context.Database.BeginTransaction();
     context.Database.ExecuteSqlRaw("SET IDENTITY_INSERT Items ON");
     context.AddRange(items);
     context.SaveChanges();
     context.Database.ExecuteSqlRaw("SET IDENTITY_INSERT Items OFF;");
     context.Database.CommitTransaction();
 }