Beispiel #1
0
 public Runner()
 {
     dbContext = new NutritionDbContext();
     dbContext.Database.EnsureCreated();
     dbContext.Database.Migrate();
     new CustomSqlDbContext().Database.Migrate();
     dbContext.Database.BeginTransaction();
 }
Beispiel #2
0
        static void Main(string[] args)
        {
            NutritionDbContext nc = new NutritionDbContext();
            var nut = new Nutrient(0, "another nut");

            nc.Nutrient.Add(nut);
            nc.SaveChanges();
            foreach (var nutter in nc.Nutrient.ToList())
            {
                Console.WriteLine(nutter.Name);
            }
        }