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 SqlOrderFactory( ApplicationLog applicationLog, OrderHistorization orderHistorization, OrderStorage orderStorage, IDateComponent dateComponent) { _applicationLog = applicationLog ?? throw new ArgumentNullException(nameof(applicationLog)); _orderHistorization = orderHistorization ?? throw new ArgumentNullException(nameof(orderHistorization)); _orderStorage = orderStorage ?? throw new ArgumentNullException(nameof(orderStorage)); _dateComponent = dateComponent ?? throw new ArgumentNullException(nameof(dateComponent)); }
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)); }