Beispiel #1
0
 static void UpdateCustomer(string ID)
 {
     //var randomRabbitName = Console.ReadLine();
     using (var db = new CustomerDbContext())
     {
         var updateCustomer = db.Customers.Find(ID);
         updateCustomer.Country += "Bolivia";
         db.Customers.Update(updateCustomer);
         db.SaveChanges();
     }
 }
Beispiel #2
0
        static void AddCustomer()
        {
            Random rand        = new Random();
            var    newCustomer = new Customer()
            {
                CustomerID  = "RABSG",
                ContactName = "Ross Brown",
                CompanyName = "Sparta Global",
                City        = "Hemel Hempstead",
                Country     = "UK"
            };

            using (var db = new CustomerDbContext())
            {
                db.Customers.Add(newCustomer);
                db.SaveChanges();
            }
        }