/// <summary> /// Initializes a new instance of the <see cref="MediaRange"/> class. /// </summary> MediaRange(MediaType type, MediaType subtype, MediaRangeParameters parameters) { Contract.Requires<ArgumentNullException>(type != null); Contract.Requires<ArgumentNullException>(subtype != null); Contract.Requires<ArgumentNullException>(parameters != null); this.type = type; this.subtype = subtype; this.parameters = parameters; }
/// <summary> /// Matched the media type with another media type. /// </summary> /// <param name="other">The media type that should be matched against.</param> /// <returns><see langword="true" /> if the media types match, otherwise <see langword="false" />.</returns> public bool Matches(MediaType other) { return IsWildcard || other.IsWildcard || value.Equals(other.value, StringComparison.InvariantCultureIgnoreCase); }