IdeaBlade DevForce 2010 Help Reference
EntityManager Constructor(EntityManager,EntityManagerContext)
See Also  Send Feedback
IdeaBlade.EntityModel Assembly > IdeaBlade.EntityModel Namespace > EntityManager Class > EntityManager Constructor : EntityManager Constructor(EntityManager,EntityManagerContext)



entityManager
EntityManager to copy settings from
entityManagerContext
EntityManager constructor parameters
Initialize a new instance of the EntityManager class using the credentials and settings from another EntityManager.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal entityManager As EntityManager, _
   Optional ByVal entityManagerContext As EntityManagerContext _
)
Visual Basic (Usage)Copy Code
Dim entityManager As EntityManager
Dim entityManagerContext As EntityManagerContext
 
Dim instance As New EntityManager(entityManager, entityManagerContext)
C# 
public EntityManager( 
   EntityManager entityManager,
   EntityManagerContext entityManagerContext
)
C++/CLI 
public:
EntityManager( 
   EntityManager^ entityManager,
   EntityManagerContext^ entityManagerContext
)

Parameters

entityManager
EntityManager to copy settings from
entityManagerContext
EntityManager constructor parameters

Exceptions

ExceptionDescription
System.ArgumentNullException is null
IdeaBlade.Core.IdeaBladeExceptionThrown for miscellaneous initialization failures
IdeaBlade.EntityModel.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 EntityManager.DefaultQueryStrategy, DefaultSaveOptions, DataSourceExtension, EntityServiceOption and VerifierEngine.

An EntityManagerCreated event is fired upon creation.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.