Example #1
0
        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;
        }
Example #2
0
 public Customer GetCustomerByEmail(CustomerEmail email)
 {
     return(UnitOfWork.Query <Customer>()
            .SingleOrDefault(x => x.Email == email));
 }