OrganizationServiceContext.Detach Method (Entity, Boolean)
Applies To: Microsoft Dynamics CRM 2013, Microsoft Dynamics CRM Online
Removes the entity from the set of entities that the OrganizationServiceContext is tracking.
Namespace: Microsoft.Xrm.Sdk.Client
Assembly: Microsoft.Xrm.Sdk (in Microsoft.Xrm.Sdk.dll)
Syntax
'Declaration
Public Function Detach ( _
entity As Entity, _
recursive As Boolean _
) As Boolean
public bool Detach (
Entity entity,
bool recursive
)
Parameters
- entity
Type: Entity. The entity to be removed from the set of entities that the OrganizationServiceContext is tracking.
- recursive
Type: Boolean. true to specify entities to be detached recursively, otherwise false.
Return Value
Type: Boolean.
Returns true if the specified entity was detached; otherwise false.
Remarks
Once an object is detached, it is no longer tracked by the OrganizationServiceContext. The Detach method can be called to detach any object, regardless of its state in the context. After detaching the specified entity, this method also detaches any links related to the entity.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Platforms
Development Platforms
Windows Server 2008, Windows Server 2012, Windows 7 (All Versions), Windows 8 (All Versions)
Target Platforms
Windows Server 2008, ,Windows Server 2012, ,Windows 7 (All Versions),
See Also
Reference
OrganizationServiceContext Class
OrganizationServiceContext Members
Microsoft.Xrm.Sdk.Client Namespace
Send comments about this topic to Microsoft.
© 2013 Microsoft Corporation. All rights reserved.