Attaches the specified Entity to the current unit of work using the requested mode for attachment

Namespace:  Mindscape.LightSpeed.ServiceModel
Assembly:  Mindscape.LightSpeed.ServiceModel (in Mindscape.LightSpeed.ServiceModel.dll)
Version: 4.0.0.0 (4.0.0.0)

Syntax

C#
public override Entity Attach(
	Entity entity,
	AttachMode mode
)
Visual Basic (Declaration)
Public Overrides Function Attach ( _
	entity As Entity, _
	mode As AttachMode _
) As Entity

Parameters

entity
Type: Mindscape.LightSpeed..::.Entity
The Entity to attach.
mode
Type: Mindscape.LightSpeed..::.AttachMode
The AttachMode to use when attaching this entity to the UnitOfWork

Return Value

An instance of the entity which has been attached to the current UnitOfWork, see the details for the AttachMode being used to determine specific behavior of the call

Implements

IUnitOfWork..::.Attach(Entity, AttachMode)
IUnitOfWork..::.Attach(Entity, AttachMode)

Remarks

AttachMode.Import is not supported on the DistributedUnitOfWork.

Examples

CopyC#
Country country = RemoteService.GetCountryFromSessionState("Ruritania");
unitOfWork.Attach(country, AttachMode.Import);

See Also