public ShoppingCartContent(ShoppingCartId id, SalesPointId salesPointId, ViewPointId viewPointId, SalesPersonId salesPersonId, CustomerId customerId, ShoppingCartStatus status) : this(id, salesPointId, viewPointId, salesPersonId, customerId, status, null) { }
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); }
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); } }