コード例 #1
0
        private void WhenCustomerLastNameChanged(CustomerLastNameChanged e, AllCustomersView view)
        {
            var existingCustomer = view.Customers.SingleOrDefault(x => x.Id == e.Id);

            if (existingCustomer == null)
            {
                throw new ApplicationException("Customer does not exist...");
            }

            existingCustomer.LastName = e.LastName;
        }
コード例 #2
0
 protected void MutateWhen(CustomerLastNameChanged @event)
 {
     LastName = @event.LastName;
 }
コード例 #3
0
 private void WhenLastNameChanged(CustomerLastNameChanged e, CustomerView view)
 {
     view.LastName = e.LastName;
 }