예제 #1
0
    /// <summary>
    /// Adds the version restrictions from <paramref name="source"/> to the <paramref name="requirements"/>.
    /// </summary>
    public static void AddRestrictions(this Requirements requirements, Requirements source)
    {
        #region Sanity checks
        if (requirements == null)
        {
            throw new ArgumentNullException(nameof(requirements));
        }
        if (source == null)
        {
            throw new ArgumentNullException(nameof(source));
        }
        #endregion

        foreach (var restriction in source.ExtraRestrictions)
        {
            requirements.AddRestriction(restriction.Key, restriction.Value);
        }
    }
예제 #2
0
    /// <summary>
    /// Adds the version restriction from <paramref name="source"/> to the <paramref name="requirements"/>.
    /// </summary>
    public static void AddRestriction(this Requirements requirements, Restriction source)
    {
        #region Sanity checks
        if (requirements == null)
        {
            throw new ArgumentNullException(nameof(requirements));
        }
        if (source == null)
        {
            throw new ArgumentNullException(nameof(source));
        }
        #endregion

        if (source.Versions != null)
        {
            requirements.AddRestriction(source.InterfaceUri, source.Versions);
        }
    }