Example #1
0
 public void AddEntity <T>(T databaseEntity)
 {
     if (databaseEntity is DatabaseCustomer)
     {
         DatabaseCustomer databaseCustomer = databaseEntity as DatabaseCustomer;
         databaseCustomer.Id = DatabaseCustomers.Count + 1;
         DatabaseCustomers.Add(databaseEntity as DatabaseCustomer);
     }
 }
Example #2
0
 public void UpdateEntity <T>(T databaseEntity)
 {
     if (databaseEntity is DatabaseCustomer)
     {
         DatabaseCustomer dbCustomer = databaseEntity as DatabaseCustomer;
         var dbCustomerToBeUpdated   = DatabaseCustomers.Find(t => t.Id == dbCustomer.Id);
         dbCustomerToBeUpdated.Address      = dbCustomer.Address;
         dbCustomerToBeUpdated.City         = dbCustomer.City;
         dbCustomerToBeUpdated.Country      = dbCustomer.Country;
         dbCustomerToBeUpdated.CustomerName = dbCustomer.CustomerName;
         dbCustomerToBeUpdated.Telephone    = dbCustomer.Telephone;
     }
 }