Exemplo n.º 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);
        }
    }
Exemplo n.º 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);
        }
    }