Advertisement
alawerda

Configuration.cs

Jul 19th, 2016
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 1.05 KB | None | 0 0
  1. namespace testintilaq2.Migrations
  2. {
  3.     using System;
  4.     using System.Data.Entity;
  5.     using System.Data.Entity.Migrations;
  6.     using System.Linq;
  7.     using testintilaq2.Models;
  8.  
  9.     internal sealed class Configuration : DbMigrationsConfiguration<testintilaq2.context.intilaqcontext>
  10.     {
  11.         public Configuration()
  12.         {
  13.             AutomaticMigrationsEnabled = false;
  14.         }
  15.  
  16.         protected override void Seed(testintilaq2.context.intilaqcontext context)
  17.         {
  18.             //  This method will be called after migrating to the latest version.
  19.  
  20.             //  You can use the DbSet<T>.AddOrUpdate() helper extension method
  21.             //  to avoid creating duplicate seed data. E.g.
  22.             //
  23.                context.Employee.AddOrUpdate(
  24.                   p => p.FirstName,
  25.                  new Employee { FirstName = "Andrew Peters" },
  26.                  new Employee { FirstName = "Brice Lambson" },
  27.                   new Employee { FirstName = "Rowan Miller" }
  28.                 );
  29.            
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement