src/Shared/EntityFramework/DbSet.cs
/// <summary>
/// Attaches the given entity to the context underlying the set.  That is, the entity is placed
/// into the context in the Unchanged state, just as if it had been read from the database.
/// </summary>
/// <param name="entity"> The entity to attach. </param>
/// <returns> The entity. </returns>
/// <remarks>
/// Attach is used to repopulate a context with an entity that is known to already exist in the database.
/// SaveChanges will therefore not attempt to insert an attached entity into the database because
/// it is assumed to already be there.
/// Note that entities that are already in the context in some other state will have their state set
/// to Unchanged.  Attach is a no-op if the entity is already in the context in the Unchanged state.
/// </remarks>
Attaches the given entity to the context underlying the set.  That is, the entity is placed
into the context in the Unchanged state, just as if it had been read from the database.
Attaches the given entity to the context underlying the set . That is the entity is placed into the context in the Unchanged state just as if it had been read from the database .
public virtual object Attach(object entity)
        {
            Check.NotNull(entity, "entity");
            GetInternalSetWithCheck("Attach").Attach(entity);
            return entity;
        }
public virtual object Attach ( object entity ) { Check . NotNull ( entity , " " ) ; GetInternalSetWithCheck ( " " ) . Attach ( entity ) ; return entity ; }
Attaches the given entity to the context underlying the set.
Attaches the given entity to the context underlying the set .
None
entity
object
The entity to attach.
The entity to attach .
remarks
Attach is used to repopulate a context with an entity that is known to already exist in the database.
SaveChanges will therefore not attempt to insert an attached entity into the database because
it is assumed to already be there.
Note that entities that are already in the context in some other state will have their state set
to Unchanged.  Attach is a no-op if the entity is already in the context in the Unchanged state.
Attach is used to repopulate a context with an entity that is known to already exist in the database . SaveChanges will therefore not attempt to insert an attached entity into the database because it is assumed to already be there . Note that entities that are already in the context in some other state will have their state set to Unchanged . Attach is a no - op if the entity is already in the context in the Unchanged state .