src/Shared/EntityFramework/Core/Objects/ObjectParameterCollection.cs
/// <summary>
/// Adds the specified <see cref="T:System.Data.Entity.Core.Objects.ObjectParameter" /> to the collection.
/// </summary>
/// <param name="item">The parameter to add to the collection.</param>
/// <exception cref="T:System.ArgumentNullException">The  parameter  argument is null.</exception>
/// <exception cref="T:System.ArgumentException">
/// The  parameter  argument already exists in the collection. This behavior differs from that of most collections that allow duplicate entries. -or-Another parameter with the same name as the  parameter  argument already exists in the collection. Note that the lookup is case-insensitive. This behavior differs from that of most collections, and is more like that of a
/// <see
///     cref="T:System.Collections.Generic.Dictionary" />
/// .
/// </exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">The type of the  parameter  is not valid.</exception>
Adds the specified  to the collection.
Adds the specified to the collection .
public void Add(ObjectParameter item)
        {
            Check.NotNull(item, "item");
            CheckUnlocked();
            if (Contains(item))
            {
                throw new ArgumentException(Strings.ObjectParameterCollection_ParameterAlreadyExists(item.Name), "item");
            }
            if (Contains(item.Name))
            {
                throw new ArgumentException(Strings.ObjectParameterCollection_DuplicateParameterName(item.Name), "item");
            }
            if (!item.ValidateParameterType(_perspective))
            {
                throw new ArgumentOutOfRangeException("item", Strings.ObjectParameter_InvalidParameterType(item.ParameterType.FullName));
            }
            _parameters.Add(item);
            _cacheKey = null;
        }
public void Add ( ObjectParameter item ) { Check . NotNull ( item , " " ) ; CheckUnlocked ( ) ; if ( Contains ( item ) ) { throw new ArgumentException ( Strings . ObjectParameterCollection_ParameterAlreadyExists ( item . Name ) , " " ) ; } if ( Contains ( item . Name ) ) { throw new ArgumentException ( Strings . ObjectParameterCollection_DuplicateParameterName ( item . Name ) , " " ) ; } if ( ! item . ValidateParameterType ( _perspective ) ) { throw new ArgumentOutOfRangeException ( " " , Strings . ObjectParameter_InvalidParameterType ( item . ParameterType . FullName ) ) ; } _parameters . Add ( item ) ; _cacheKey = null ; }
Adds the specified  to the collection.
Adds the specified to the collection .
The  parameter  argument is null.
The parameter argument is null .
The  parameter  argument already exists in the collection. This behavior differs from that of most collections that allow duplicate entries. -or-Another parameter with the same name as the  parameter  argument already exists in the collection. Note that the lookup is case-insensitive. This behavior differs from that of most collections, and is more like that of a


The parameter argument already exists in the collection . This behavior differs from that of most collections that allow duplicate entries . - or - Another parameter with the same name as the parameter argument already exists in the collection . Note that the lookup is case - insensitive . This behavior differs from that of most collections and is more like that of a
The type of the  parameter  is not valid.
The type of the parameter is not valid .
item
ObjectParameter
The parameter to add to the collection.
The parameter to add to the collection .