/// <summary> /// Sign up customer by form information /// </summary> /// <param name="name"></param> /// <param name="email"></param> /// <param name="password"></param> public void SignUpCustomer(string name, string email, string password) { if (repo.GetCustomerByEmail(email) != null) { Log.Warning("Existing user attempted new sign up."); throw new Exception("Customer already exists!"); } Customer newCustomer = new Customer(name, email, password); AddCustomer(newCustomer); SaveChanges(); }
public async Task <bool> CustomerExist(RequestCustomerUpdateModel customer) { var email = customer.Email; var c = await _customerRepo.GetCustomerByEmail(email); if (c == null) { return(false); } return(true); }
public Customer GetCustomerByEmail(string email) { Customer customer = custRepo.GetCustomerByEmail(email); return(customer); }