src/Shared/EntityFramework/DbSet.cs
/// <summary>
/// Adds the given entity to the context underlying the set in the Added state such that it will
/// be inserted into the database when SaveChanges is called.
/// </summary>
/// <param name="entity"> The entity to add. </param>
/// <returns> The entity. </returns>
/// <remarks>
/// Note that entities that are already in the context in some other state will have their state set
/// to Added.  Add is a no-op if the entity is already in the context in the Added state.
/// </remarks>
Adds the given entity to the context underlying the set in the Added state such that it will
be inserted into the database when SaveChanges is called.
Adds the given entity to the context underlying the set in the Added state such that it will be inserted into the database when SaveChanges is called .
public virtual object Add(object entity)
        {
            Check.NotNull(entity, "entity");
            GetInternalSetWithCheck("Add").Add(entity);
            return entity;
        }
public virtual object Add ( object entity ) { Check . NotNull ( entity , " " ) ; GetInternalSetWithCheck ( " " ) . Add ( entity ) ; return entity ; }
Adds the given entity to the context underlying the set in the Added state such that it will
be inserted into the database when SaveChanges is called.
Adds the given entity to the context underlying the set in the Added state such that it will be inserted into the database when SaveChanges is called .
None
entity
object
The entity to add.
The entity to add .
remarks
Note that entities that are already in the context in some other state will have their state set
to Added.  Add is a no-op if the entity is already in the context in the Added state.
Note that entities that are already in the context in some other state will have their state set to Added . Add is a no - op if the entity is already in the context in the Added state .