Exemple #1
0
        public virtual bool IsValid(IEnumerable <EntityTag> entityTags, EntityTagComparison comparisonType = EntityTagComparison.Strong)
        {
            if (entityTags == null)
            {
                throw new ArgumentNullException("entityTags");
            }

            return(validTags.Any(t1 => entityTags.Any(t2 => t1.Equals(t2, comparisonType))));
        }
Exemple #2
0
        public virtual bool IsValid(EntityTag entityTag, EntityTagComparison comparisonType = EntityTagComparison.Strong)
        {
            if (entityTag == null)
            {
                throw new ArgumentNullException("entityTag");
            }

            return(IsValid(new[] { entityTag }, comparisonType));
        }
Exemple #3
0
        public bool Equals(EntityTag other, EntityTagComparison comparisonType = EntityTagComparison.Strong)
        {
            if (other == null)
            {
                return(false);
            }

            switch (comparisonType)
            {
            case EntityTagComparison.Strong:
                return(!IsWeak && !other.IsWeak && Value == other.Value);

            case EntityTagComparison.Weak:
                return(Value == other.Value);

            default:
                throw new InvalidProgramException("Unknown EntityTagComparisonType." + comparisonType);
            }
        }
Exemple #4
0
 public override bool IsValid(IEnumerable <EntityTag> entityTags, EntityTagComparison comparisonType = EntityTagComparison.Strong)
 {
     return(entityTags.Any());
 }