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)))); }
public virtual bool IsValid(EntityTag entityTag, EntityTagComparison comparisonType = EntityTagComparison.Strong) { if (entityTag == null) { throw new ArgumentNullException("entityTag"); } return(IsValid(new[] { entityTag }, comparisonType)); }
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); } }
public override bool IsValid(IEnumerable <EntityTag> entityTags, EntityTagComparison comparisonType = EntityTagComparison.Strong) { return(entityTags.Any()); }