public void AddOnlineBook(CustomerOnlineBook customerOnlineBook) { if (isOnlineBookExistsInCustomerList(customerOnlineBook) == true) { Console.WriteLine("Online book is already exists in customer list"); } else { using (var newDal = new DBdal()) { newDal.customerOnlineBooks.Add(customerOnlineBook); newDal.SaveChanges(); } } }
public void addCustomer(Customer customer) { dal.customers.Add(customer); dal.SaveChanges(); }