EntityManager Class
EntityManager Class Breeze.sharp
Instances of the EntityManager contain and manage collections of entities, either retrieved from a backend datastore or created on the client.
Inheritance Hierarchy

SystemObject
  Breeze.SharpEntityManager

Namespace: Breeze.Sharp
Assembly: Breeze.Sharp (in Breeze.Sharp.dll) Version: 0.6.0.5 (0.6.0.5)
Syntax

public class EntityManager

The EntityManager type exposes the following members.

Constructors

  NameDescription
Public methodEntityManager(EntityManager)
Creates a new EntityManager with the same configuration as another EntityManager but without any entities.
Public methodEntityManager(String, MetadataStore)
Constructs an empty EntityManager with a specified data service name.
Public methodEntityManager(DataService, MetadataStore)
///
Constructs an empty EntityManager with a specified DataService.
Top
Methods

  NameDescription
Public methodAcceptChanges
Calls AcceptChanges on each Added, Deleted or Modified entity within the cache. All pending changes will be considered complete and after this call the EntityManager will have no pending changes.
Public methodAddEntity
Attaches a detached entity to this EntityManager and sets its EntityState to 'Added'.
Public methodAttachEntity
Attaches a detached entity to this EntityManager and sets its EntityState to a specified state.
Public methodCheckAuthorizedThreadId
Public methodClear
Removes all entities from this EntityManager.
Public methodCreateEntity(Type, Object, EntityState)
Creates a new entity and sets its EntityState. Unless this state is Detached, the entity is also added to the EntityManager.
Public methodCreateEntity(EntityType, Object, EntityState)
Creates a new entity and sets its EntityState. Unless this state is Detached, the entity is also added to the EntityManager.
Public methodCreateEntityT(EntityState)
Creates a new entity and sets its EntityState. Unless this state is Detached, the entity is also added to the EntityManager.
Public methodCreateEntityT(Object, EntityState)
Creates a new entity and sets its EntityState. Unless this state is Detached, the entity is also added to the EntityManager.
Public methodDetachEntity
Removes a specified entity from this EntityManager. Note this is NOT a deletion. It simply causes the EntityManager to 'forget' about this entity.
Public methodEnableChangeNotification
Turns on or off change notification events for a specific entity type.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodExecuteQuery(EntityQuery)
Performs an asynchronous query and that returns an untyped result.
Public methodExecuteQuery(EntityQuery, CancellationToken)
Performs an asynchronous query and that returns an untyped result.
Public methodExecuteQueryT(EntityQueryT)
Performs an asynchronous query and that returns a typed result.
Public methodExecuteQueryT(EntityQueryT, CancellationToken)
Performs an asynchronous query and that returns a typed result.
Public methodExecuteQueryLocally(EntityQuery)
Executes the specified query against the local cache and returns an untyped result.
Public methodExecuteQueryLocallyT(EntityQueryT)
Executes the specified query against the local cache and returns a typed result.
Public methodExportEntities(IEnumerableIEntity, Boolean)
Exports a specified list of entities as a string, with the option to include metadata
Public methodExportEntities(IEnumerableIEntity, Boolean, TextWriter)
Exports a specified list of entities via a TextWriter, with the option to include metadata
Public methodFetchEntityByKey(EntityKey, Boolean)
Performs an asynchronous query that optionally checks the local cache first.
Public methodFetchEntityByKey(EntityKey, CancellationToken, Boolean)
Performs an asynchronous query that optionally checks the local cache first.
Public methodFetchMetadata(DataService)
Fetches the metadata associated with the EntityManager's current 'serviceName'. This call also occurs internally before the first query to any service if the metadata hasn't already been loaded.
Public methodFetchMetadata(CancellationToken, DataService)
Fetches the metadata associated with the EntityManager's current 'serviceName'. This call also occurs internally before the first query to any service if the metadata hasn't already been loaded.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGenerateId
Generates a temporary ID for an IEntity. The temporary ID will be mapped to a real ID when SaveChanges(SaveOptions) is called.
Public methodGetChanges(IEnumerableType)
Returns a collection of all of the pending changes within this EntityManager for a specified list of entity types.
Public methodGetChanges(Type)
Returns a collection of all of the pending changes within this EntityManager.
Public methodGetEntities(Type)
Retrieves all entities of the specified types from cache.
Public methodGetEntities(EntityState)
Find all entities in cache having the specified entity state(s).
Public methodGetEntities(IEnumerableType, EntityState)
Retrieves all entities of the specified types with the specified entity state(s) from cache.
Public methodGetEntities(Type, EntityState)
Retrieves all entities of a specified type with the specified entity state(s) from cache.
Public methodGetEntitiesT(EntityState)
Retrieves all entities of a specified type with the specified entity state(s) from cache as a typed enumerable.
Public methodGetEntityByKey(EntityKey)
Attempts to return a specific entity within the local cache by its key and returns a null if not found.
Public methodGetEntityByKeyT(Object)
Attempts to return a specific entity within the local cache by its key and returns a null if not found.
Public methodGetEntityByKeyT(EntityKey)
Attempts to return a specific entity within the local cache by its key and returns a null if not found.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodHasChanges
Returns whether there are any pending changes for this EntityManager or for selected types within this EntityManager.
Public methodImportEntities(TextReader, ImportOptions)
Imports the result of a previously executed ExportEntities call via a TextReader.
Public methodImportEntities(String, ImportOptions)
Imports the string result of a previously executed ExportEntities call.
Public methodIsChangeNotificationEnabled
Whether change notification events are enabled for a specific entity type.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRejectChanges
Calls RejectChanges on each Added, Deleted or Modified entity within the cache. All pending changes will be lost and after this call the EntityManager will have no pending changes.
Public methodSaveChanges(SaveOptions)
Performs an asynchronous saves of all pending changes within this EntityManager.
Public methodSaveChanges(IEnumerableIEntity, SaveOptions)
Performs an asynchronous save of just the specified entities within this EntityManager.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties

  NameDescription
Public propertyAuthorizedThreadId
Public propertyCacheQueryOptions
The CacheQueryOptions to be used when querying the local cache.
Public propertyChangeNotificationEnabled
Whether or not change notification events will be fired. This includes both EntityChange and PropertyChange events.
Public propertyCurrentThreadId
Public propertyDataService
The default DataService for this EntityManager.
Public propertyDefaultQueryOptions
Default QueryOptions for this EntityManager. These may be overriden for any specific query.
Public propertyDefaultSaveOptions
Default SaveOptions for this EntityManager. These may be overriden for any specific save.
Public propertyKeyGenerator
Public propertyMetadataStore
Public propertyValidationOptions
Validation options.
Top
Events

  NameDescription
Public eventEntityChanged
Fired whenever an entity's state has changed in any significant manner.
Public eventEntityChanging
Fired whenever an entity's state is changing in any significant manner.
Public eventHasChangesChanged
Top
See Also

Reference