public Customer(CustomerName customerName, CustomerEmail customerEmail) : this() { _name = customerName ?? throw new ArgumentNullException(nameof(customerName)); _email = customerEmail ?? throw new ArgumentNullException(nameof(customerEmail)); MoneySpent = Dollars.Of(0); Status = CustomerStatus.Regular; }
public Customer GetCustomerByEmail(CustomerEmail email) { return(UnitOfWork.Query <Customer>() .SingleOrDefault(x => x.Email == email)); }