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