Esempio n. 1
0
        public void Handle(MembershipActivated e)
        {
            var customer = _repository.Get(e.CustomerId) ?? new CustomerMemberships(e.CustomerId, new List <MembershipInfo>());
            var info     = new MembershipInfo(e.OrderId, e.Description, e.Price, e.ActivationTime);

            customer.Activate(info);
            _repository.Save(customer);

            Console.WriteLine($"Membership activated for order {e.OrderId}:");
            Console.WriteLine($"\tDescription: {e.Description}");
            Console.WriteLine($"\tPrice: {e.Price}");
        }
Esempio n. 2
0
 public void Activate(MembershipInfo m)
 {
     Memberships.Add(m);
 }