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);
        }
Example #2
0
 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)
 {
 }