예제 #1
0
 public ShoppingCartContent(ShoppingCartId id,
                            SalesPointId salesPointId,
                            ViewPointId viewPointId,
                            SalesPersonId salesPersonId,
                            CustomerId customerId,
                            ShoppingCartStatus status)
     :
     this(id, salesPointId, viewPointId, salesPersonId, customerId, status, null)
 {
 }
예제 #2
0
        public static bool Equals(ShoppingCartContent?left, ShoppingCartContent?right)
        {
            bool result = ShoppingCartId.Equals(left?.Id, right?.Id);

            result &= (result ? SalesPointId.Equals(left?.SalesPointId, right?.SalesPointId) : false);
            result &= (result ? ViewPointId.Equals(left?.ViewPointId, right?.ViewPointId) : false);
            result &= (result ? SalesPersonId.Equals(left?.SalesPersonId, right?.SalesPersonId) : false);
            result &= (result ? CustomerId.Equals(left?.CustomerId, right?.CustomerId) : false);
            result &= (result ? ShoppingCartStatus.Equals(left?.Status, right?.Status) : false);
            result &= (result ? (left?.Items.SequenceEqual(right?.Items)).GetValueOrDefault() : false);

            return(result);
        }
예제 #3
0
        public ShoppingCartContent(ShoppingCartId id,
                                   SalesPointId salesPointId,
                                   ViewPointId viewPointId,
                                   SalesPersonId salesPersonId,
                                   CustomerId customerId,
                                   ShoppingCartStatus status,
                                   IEnumerable <ShoppingCartItem>?items)
        {
            this.Id            = id;
            this.SalesPointId  = salesPointId;
            this.ViewPointId   = viewPointId;
            this.SalesPersonId = salesPersonId;
            this.CustomerId    = customerId;
            this.Status        = status;

            if (items is not null)
            {
                this.Items.AddRange(items);
            }
        }