Table<TEntity>.ITable.Attach Table<TEntity>.ITable.Attach Table<TEntity>.ITable.Attach Method

Definition

Allows deserialized entities to be associated with a new instance of a DataContext so that they can be updated or deleted from the database.

Overloads

ITable.Attach(Object, Boolean) ITable.Attach(Object, Boolean) ITable.Attach(Object, Boolean)

Attaches all entities of a collection to the DataContext in either a modified or unmodified state.

ITable.Attach(Object, Object) ITable.Attach(Object, Object) ITable.Attach(Object, Object)

Attaches an entity to the DataContext in either a modified or unmodified state by specifying both the entity and its original state.

ITable.Attach(Object) ITable.Attach(Object) ITable.Attach(Object)

Attaches an entity to the DataContext in an unmodified state.

ITable.Attach(Object, Boolean) ITable.Attach(Object, Boolean) ITable.Attach(Object, Boolean)

Attaches all entities of a collection to the DataContext in either a modified or unmodified state.

 virtual void System.Data.Linq.ITable.Attach(System::Object ^ entity, bool asModified) = System::Data::Linq::ITable::Attach;
void ITable.Attach (object entity, bool asModified);
Sub Attach (entity As Object, asModified As Boolean) Implements ITable.Attach

Parameters

entity
Object Object Object

The entity to be attached.

asModified
Boolean Boolean Boolean

true to attach the entity as modified; false to attached the entity as unmodified.

Implements

Remarks

This member is an explicit interface member implementation. It can be used only when the Table<TEntity> instance is cast to an ITable interface.

ITable.Attach(Object, Object) ITable.Attach(Object, Object) ITable.Attach(Object, Object)

Attaches an entity to the DataContext in either a modified or unmodified state by specifying both the entity and its original state.

 virtual void System.Data.Linq.ITable.Attach(System::Object ^ entity, System::Object ^ original) = System::Data::Linq::ITable::Attach;
void ITable.Attach (object entity, object original);
Sub Attach (entity As Object, original As Object) Implements ITable.Attach

Parameters

entity
Object Object Object

The entity to be attached.

original
Object Object Object

An instance of the same entity type with data members that contain the original values.

Implements

Remarks

This member is an explicit interface member implementation. It can be used only when the Table<TEntity> instance is cast to an ITable interface.

ITable.Attach(Object) ITable.Attach(Object) ITable.Attach(Object)

Attaches an entity to the DataContext in an unmodified state.

 virtual void System.Data.Linq.ITable.Attach(System::Object ^ entity) = System::Data::Linq::ITable::Attach;
void ITable.Attach (object entity);
Sub Attach (entity As Object) Implements ITable.Attach

Parameters

entity
Object Object Object

The entity to be attached.

Implements

Remarks

This member is an explicit interface member implementation. It can be used only when the Table<TEntity> instance is cast to an ITable interface.

Applies to