//Add method - or Create from CRUD public bool AddCustomer(KomodoCustomer customer) { int startingCount = _customerDirectory.Count; _customerDirectory.Add(customer); bool wasAdded = startingCount < _customerDirectory.Count ? true : false; return(wasAdded); }
//Update Customer Information public bool UpdateCustomerInformation(int id, string lastName, int age) { //first get customer by id KomodoCustomer customer = GetKomodoCustomerById(id); if (customer != null) { customer.LastName = lastName; customer.Age = age; return(true); } else { return(false); } }
//Delete method public bool DeleteCustomerInformation(KomodoCustomer customer) { bool isDeleted = _customerDirectory.Remove(customer); return(isDeleted); }