コード例 #1
0
ファイル: Order.cs プロジェクト: ena-mx/TravelExpress
        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);
        }
コード例 #2
0
 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));
 }
コード例 #3
0
 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));
 }