Beispiel #1
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);
            }
        }
Beispiel #2
0
 public void Write_Nutrient()
 {
     dbContext.Nutrient.Add(new Nutrient(id: 0, shortCode: "TEST", name: "Test Nutrient"));
     dbContext.SaveChanges();
     Assert.NotNull(dbContext.Nutrient.ToList().FirstOrDefault(n => n.Name == "Test Nutrient"));
 }