DevForce Help Reference
EntityManager Class
Members 


Management class for all high-level retrieval, caching and persistence operations on entities.
Object Model
EntityManager ClassIAuthenticationContext InterfaceCacheStateManager ClassCompositionContext ClassEntityReferenceStrategy ClassQueryStrategy ClassSaveOptions ClassEntityMetadataStore ClassEntityManagerOptions ClassQueryCache ClassVerifierEngine Class
Syntax
'Declaration
 
<DebuggerNonUserCodeAttribute()>
Public Class EntityManager 
'Usage
 
Dim instance As EntityManager
[DebuggerNonUserCode()]
public class EntityManager 
Remarks
The EntityManager is responsible for communicating with an IdeaBlade.EntityModel.Server.EntityServer to retrieve entities from and persist entities to their backend data sources, managing entities in its cache, creating new entities, ensuring entity security, and persisting its cache to local storage to facilitate disconnected access.

A single EntityManager can manage entities backed by any number of data sources. It caches entities and queries, both to improve performance and to support offline operation of applications. Entities remain in the cache until the application terminates or they are explicitly removed.

Use Login and IdeaBlade.EntityModel.Security.Authenticator.Logout to validate a user's credentials and provide session-level security to the IdeaBlade.EntityModel.Server.EntityServer. You'll need to implement IEntityLoginManager to perform this validation. If login security is required, be sure to call Login prior to performing any other EntityManager actions.

Use Connect and Disconnect to explicitly manage connection state to the EntityServer. Use the EntityServerError delegate to set up an error handler to catch connection and other EntityServer problems.

Use any of the ExecuteQuery overloads to explicitly retrieve entities from either a backend data source or the EntityManager's cache. When using an EntityQuery or any query implementing System.Collections.IEnumerable you can also take advantage of "deferred execution" and implicitly retrieve the requested results by enumerating over the query or calling either ToList() or ToArray(). For more information on deferred vs. immediate execution and LINQ queries, see the Language-Integrated Query topic in the Visual Studio documentation.

Use CreateEntity or its overloads to create new entity instances, and AddEntity to add the new entity to the entity cache. Use one of the SaveChanges overloads to persist changed entities to a backend data source.

Use CacheStateManager.SaveCacheState to save cached data and the state of the EntityManager to the local file system. Use CacheStateManager.RestoreCacheState to restore from the saved file. Use ImportEntities to move entities between EntityManagers.

Corresponding asynchronous methods are available for any operation which may access the EntityServer. See ConnectAsync, IdeaBlade.EntityModel.Security.Authenticator.LoginAsync, ExecuteQueryAsync(IEntityQuery), SaveChangesAsync and InvokeServerMethodAsync(ServerMethodDelegate,Object[]).

Note: The EntityManager is not thread-safe.

Inheritance Hierarchy

System.Object
   IdeaBlade.EntityModel.EntityManager

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 Members
IdeaBlade.EntityModel Namespace
IEntity Interface
EntityQuery Class
PassthruEsqlQuery Class
StoredProcQuery Class

Send Feedback