public OrderCreationService(IOrderRepository orderRepository,
                             ICoffeeCupRepository coffeeCupRepository)
 {
     _orderRepository =
         orderRepository ?? throw new ArgumentNullException(nameof(orderRepository));
     _coffeeCupRepository =
         coffeeCupRepository ?? throw new ArgumentNullException(nameof(coffeeCupRepository));
 }
Ejemplo n.º 2
0
 public CoffeeCupViewModel(ICoffeeCupRepository coffeeCupRepository,
                           ICustomerRepository customerRepository,
                           IOrderRepository orderRepository)
 {
     _coffeeCupRepository    = coffeeCupRepository;
     _customerRepository     = customerRepository;
     _orderRepository        = orderRepository;
     CoffeeCups              = new ObservableCollection <CoffeeCup>();
     ProduceCoffeeCupCommand = new DelegateCommand(ProduceCoffeeCupExecute);
 }
 public CustomerViewModel(ICustomerRepository customerRepository,
                          IOrderRepository orderRepository,
                          ICoffeeCupRepository coffeeCupRepository,
                          IOrderCreationService orderCreationService)
 {
     _customerRepository              = customerRepository;
     _orderRepository                 = orderRepository;
     _coffeeCupRepository             = coffeeCupRepository;
     _orderCreationService            = orderCreationService;
     Customers                        = new ObservableCollection <Customer>();
     CustomerOrderWrappers            = new ObservableCollection <OrderWrapper>();
     OrderCoffeeCups                  = new ObservableCollection <CoffeeCup>();
     CreateOrderCommand               = new DelegateCommand(CreateOrderExecute, CreateOrderCanExecute);
     SetOrderStatusToProcessedCommand = new DelegateCommand(SetOrderStatusToProcessedExecute, SetOrderStatusToProcessedCanExecute);
 }