Editare

Partajați prin


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)

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

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)

Attaches an entity to the DataContext in an unmodified state.

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);
abstract member System.Data.Linq.ITable.Attach : obj * bool -> unit
override this.System.Data.Linq.ITable.Attach : obj * bool -> unit
Sub Attach (entity As Object, asModified As Boolean) Implements ITable.Attach

Parameters

entity
Object

The entity to be attached.

asModified
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.

Applies to

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);
abstract member System.Data.Linq.ITable.Attach : obj * obj -> unit
override this.System.Data.Linq.ITable.Attach : obj * obj -> unit
Sub Attach (entity As Object, original As Object) Implements ITable.Attach

Parameters

entity
Object

The entity to be attached.

original
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.

Applies to

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);
abstract member System.Data.Linq.ITable.Attach : obj -> unit
override this.System.Data.Linq.ITable.Attach : obj -> unit
Sub Attach (entity As Object) Implements ITable.Attach

Parameters

entity
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