EntityCollection<TEntity>.Add Method (TEntity)

 

Adds an object to the collection.

Namespace:   System.Data.Entity.Core.Objects.DataClasses
Assembly:  EntityFramework (in EntityFramework.dll)

public void Add(
	TEntity item
)

Parameters

item
Type: TEntity

An object to add to the collection. entity must implement IEntityWithRelationships .

Exception Condition
ArgumentNullException

entity is null.