public Order( Guid orderId, Guid billId, Guid customerId, OrderHistorization orderHistorization, OrderStorage orderStorage, IDateComponent dateComponent, UserHistorizationComponent userHistorizationComponent) { if (orderHistorization == null) { throw new ArgumentNullException(nameof(orderHistorization)); } if (orderStorage == null) { throw new ArgumentNullException(nameof(orderStorage)); } if (dateComponent == null) { throw new ArgumentNullException(nameof(dateComponent)); } if (userHistorizationComponent == null) { throw new ArgumentNullException(nameof(userHistorizationComponent)); } _orderId = orderId; _billId = billId; _customerId = customerId; OrderState = new OrderConfirmedState(this, orderHistorization, orderStorage, dateComponent, userHistorizationComponent); }
public CustomerComponent( Guid customerId, CustomerStorageComponent customerStorage, CustomerHistorization customerHistorization, IDateComponent dateComponent, UserHistorizationComponent userHistorizationComponent) { if (customerStorage == null) { throw new ArgumentNullException(nameof(customerStorage)); } if (customerHistorization == null) { throw new ArgumentNullException(nameof(customerHistorization)); } if (dateComponent == null) { throw new ArgumentNullException(nameof(dateComponent)); } if (userHistorizationComponent == null) { throw new ArgumentNullException(nameof(userHistorizationComponent)); } _customerId = customerId; State = new ExistingCustomerState(this, customerStorage, customerHistorization, dateComponent, userHistorizationComponent); }
public OrderConfirmedState( Order order, OrderHistorization orderHistorization, OrderStorage orderStorage, IDateComponent dateComponent, UserHistorizationComponent userHistorizationComponent) { _order = order ?? throw new ArgumentNullException(nameof(order)); _orderHistorization = orderHistorization ?? throw new ArgumentNullException(nameof(orderHistorization)); _orderStorage = orderStorage; _dateComponent = dateComponent ?? throw new ArgumentNullException(nameof(dateComponent)); _userHistorizationComponent = userHistorizationComponent ?? throw new ArgumentNullException(nameof(userHistorizationComponent)); }
protected CustomerState( CustomerComponent customerComponent, CustomerStorageComponent customerStorage, CustomerHistorization customerHistorization, IDateComponent dateComponent, UserHistorizationComponent userHistorizationComponent) { _customerComponent = customerComponent ?? throw new ArgumentNullException(nameof(customerComponent)); _customerStorage = customerStorage ?? throw new ArgumentNullException(nameof(customerStorage)); _customerHistorization = customerHistorization ?? throw new ArgumentNullException(nameof(customerHistorization)); _dateComponent = dateComponent ?? throw new ArgumentNullException(nameof(dateComponent)); _userHistorizationComponent = userHistorizationComponent ?? throw new ArgumentNullException(nameof(userHistorizationComponent)); }
public ExistingCustomerState(CustomerComponent customerComponent, CustomerStorageComponent customerStorage, CustomerHistorization customerHistorization, IDateComponent dateComponent, UserHistorizationComponent userHistorizationComponent) : base(customerComponent, customerStorage, customerHistorization, dateComponent, userHistorizationComponent) { }