Ejemplo n.º 1
0
 public List<Manufacturer> GetData()
 {
     using (var context = new Context())
     {
         var manufacturers = context.Manufacturers.ToList();
         return manufacturers;
     }
 }
Ejemplo n.º 2
0
 private void AddDefaultData()
 {
     using (var context = new Context())
     {
         var manufacturer = new Manufacturer { Id = 1, Name = "Ford" };
         var data = context.Manufacturers.Add(manufacturer);
         //context.Manufacturers.AddOrUpdate(manufacturer);
         var listLength = GetData().Count;
         //context.SaveChanges();
     }
 }