DevForce Help Reference
EntityManager Constructor(EntityManager,EntityManagerContext)


EntityManager to copy settings from
EntityManager constructor parameters
Initialize a new instance of the EntityManager class using the credentials and settings from another EntityManager.
Syntax
'Declaration
 
Public Function New( _
   ByVal entityManager As EntityManager, _
   Optional ByVal entityManagerContext As EntityManagerContext _
)
'Usage
 
Dim entityManager As EntityManager
Dim entityManagerContext As EntityManagerContext
 
Dim instance As New EntityManager(entityManager, entityManagerContext)

Parameters

entityManager
EntityManager to copy settings from
entityManagerContext
EntityManager constructor parameters
Exceptions
ExceptionDescription
System.ArgumentNullExceptionentityManager is null
IdeaBlade.Core.IdeaBladeExceptionThrown for miscellaneous initialization failures
EntityServerExceptionThrown for connection failures
System.ArgumentExceptionThrown in a Silverlight application when BOS is not specified
Remarks
This copy constructor will create a new "empty" (no data) EntityManager with the same settings, defaults and connection status as the specified EntityManager. The new EntityManager will be "logged in" to the EntityServer with the credentials already provided in the passed EntityManager.

The VerifierEngine associated with this new EntityManager is determined by whether this ctor is called on the same thread as the entityManager passed in. If so, then the two entityManagers will share a single VerifierEngine, if not, a new VerifierEngine will be created for this entityManager. This behavior is intended to avoid threading issues because VeriferEngines ( like EntityManagers) are not thread safe.

Other than the login credentials and connection state, the settings copied from the source EntityManager are DefaultQueryStrategy, DefaultSaveOptions, DataSourceExtension, EntityServiceOption and VerifierEngine.

An EntityManagerCreated event is fired upon creation.

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

EntityManager Class
EntityManager Members
Overload List

Send Feedback