Пример #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Id.GetHashCode();
         hashCode = (hashCode * 397) ^ (Code != null ? Code.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Value.GetHashCode();
         hashCode = (hashCode * 397) ^ EndsAt.GetHashCode();
         hashCode = (hashCode * 397) ^ StartsAt.GetHashCode();
         hashCode = (hashCode * 397) ^ (Status != null ? Status.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ UsageLimit.GetHashCode();
         hashCode = (hashCode * 397) ^ AppliesToId.GetHashCode();
         hashCode = (hashCode * 397) ^ (DiscountType != null ? DiscountType.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (AppliesTo != null ? AppliesTo.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (AppliesToResource != null ? AppliesToResource.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ TimesUsed.GetHashCode();
         hashCode = (hashCode * 397) ^ (Duration != null ? Duration.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ DurationUsageLimit.GetHashCode();
         hashCode = (hashCode * 397) ^ (AppliesToProductType != null ? AppliesToProductType.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ CreatedAt.GetHashCode();
         hashCode = (hashCode * 397) ^ UpdatedAt.GetHashCode();
         hashCode = (hashCode * 397) ^ OncePerCustomer.GetHashCode();
         return(hashCode);
     }
 }
Пример #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         return((StartsAt.GetHashCode() * 397) ^ EndsAt.GetHashCode());
     }
 }
        public DiscountCodeEdit()
        {
            StartsAt  = DateTime.UtcNow;
            ExpiresAt = StartsAt.AddDays(30);
            IsActive  = true;
            IsGlobal  = true;

            TourItems = ProductItems = ProductVariantItems = new SelectListItem[0];
        }
Пример #4
0
        public override int GetHashCode()
        {
            int hashCode = 955995587;

            hashCode = hashCode * -1521134295 + StartsAt.GetHashCode();
            hashCode = hashCode * -1521134295 + EndsAt.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(FilePath);

            return(hashCode);
        }
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = StartsAt.GetHashCode();
         hashCode = (hashCode * 397) ^ UsageLimit.GetHashCode();
         hashCode = (hashCode * 397) ^ (Status != null ? Status.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ EndsAt.GetHashCode();
         return(hashCode);
     }
 }
Пример #6
0
 public bool Equals(DateTimeRange other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(StartsAt.Equals(other.StartsAt) && EndsAt.Equals(other.EndsAt));
 }