Instances of the EntityManager contain and manage collections of entities,
either retrieved from a backend datastore or created on the client.
Inheritance Hierarchy
Breeze.SharpEntityManager
Namespace: Breeze.Sharp
Assembly: Breeze.Sharp (in Breeze.Sharp.dll) Version: 0.6.0.5 (0.6.0.5)
Syntax
The EntityManager type exposes the following members.
Constructors
Name | Description | |
---|---|---|
EntityManager(EntityManager) |
Creates a new EntityManager with the same configuration as another EntityManager but without any entities.
| |
EntityManager(String, MetadataStore) |
Constructs an empty EntityManager with a specified data service name.
| |
EntityManager(DataService, MetadataStore) |
///
Constructs an empty EntityManager with a specified DataService.
|
Methods
Name | Description | |
---|---|---|
AcceptChanges |
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.
| |
AddEntity |
Attaches a detached entity to this EntityManager and sets its EntityState to 'Added'.
| |
AttachEntity |
Attaches a detached entity to this EntityManager and sets its EntityState to a specified state.
| |
CheckAuthorizedThreadId | ||
Clear |
Removes all entities from this EntityManager.
| |
CreateEntity(Type, Object, EntityState) |
Creates a new entity and sets its EntityState. Unless this state is Detached, the entity
is also added to the EntityManager.
| |
CreateEntity(EntityType, Object, EntityState) |
Creates a new entity and sets its EntityState. Unless this state is Detached, the entity
is also added to the EntityManager.
| |
CreateEntityT(EntityState) |
Creates a new entity and sets its EntityState. Unless this state is Detached, the entity
is also added to the EntityManager.
| |
CreateEntityT(Object, EntityState) |
Creates a new entity and sets its EntityState. Unless this state is Detached, the entity
is also added to the EntityManager.
| |
DetachEntity |
Removes a specified entity from this EntityManager. Note this is NOT a deletion. It simply causes
the EntityManager to 'forget' about this entity.
| |
EnableChangeNotification |
Turns on or off change notification events for a specific entity type.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
ExecuteQuery(EntityQuery) |
Performs an asynchronous query and that returns an untyped result.
| |
ExecuteQuery(EntityQuery, CancellationToken) |
Performs an asynchronous query and that returns an untyped result.
| |
ExecuteQueryT(EntityQueryT) |
Performs an asynchronous query and that returns a typed result.
| |
ExecuteQueryT(EntityQueryT, CancellationToken) |
Performs an asynchronous query and that returns a typed result.
| |
ExecuteQueryLocally(EntityQuery) |
Executes the specified query against the local cache and returns an untyped result.
| |
ExecuteQueryLocallyT(EntityQueryT) |
Executes the specified query against the local cache and returns a typed result.
| |
ExportEntities(IEnumerableIEntity, Boolean) |
Exports a specified list of entities as a string, with the option to include metadata
| |
ExportEntities(IEnumerableIEntity, Boolean, TextWriter) |
Exports a specified list of entities via a TextWriter, with the option to include metadata
| |
FetchEntityByKey(EntityKey, Boolean) |
Performs an asynchronous query that optionally checks the local cache first.
| |
FetchEntityByKey(EntityKey, CancellationToken, Boolean) |
Performs an asynchronous query that optionally checks the local cache first.
| |
FetchMetadata(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.
| |
FetchMetadata(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.
| |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GenerateId |
Generates a temporary ID for an IEntity. The temporary ID will be mapped to a real ID when
SaveChanges(SaveOptions) is called.
| |
GetChanges(IEnumerableType) |
Returns a collection of all of the pending changes within this EntityManager for a specified list of entity types.
| |
GetChanges(Type) |
Returns a collection of all of the pending changes within this EntityManager.
| |
GetEntities(Type) |
Retrieves all entities of the specified types from cache.
| |
GetEntities(EntityState) |
Find all entities in cache having the specified entity state(s).
| |
GetEntities(IEnumerableType, EntityState) |
Retrieves all entities of the specified types with the specified entity state(s) from cache.
| |
GetEntities(Type, EntityState) |
Retrieves all entities of a specified type with the specified entity state(s) from cache.
| |
GetEntitiesT(EntityState) |
Retrieves all entities of a specified type with the specified entity state(s) from cache as a typed enumerable.
| |
GetEntityByKey(EntityKey) |
Attempts to return a specific entity within the local cache by its key and returns a null if not found.
| |
GetEntityByKeyT(Object) |
Attempts to return a specific entity within the local cache by its key and returns a null if not found.
| |
GetEntityByKeyT(EntityKey) |
Attempts to return a specific entity within the local cache by its key and returns a null if not found.
| |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
HasChanges |
Returns whether there are any pending changes for this EntityManager or for selected types within this EntityManager.
| |
ImportEntities(TextReader, ImportOptions) |
Imports the result of a previously executed ExportEntities call via a TextReader.
| |
ImportEntities(String, ImportOptions) |
Imports the string result of a previously executed ExportEntities call.
| |
IsChangeNotificationEnabled |
Whether change notification events are enabled for a specific entity type.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
RejectChanges |
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.
| |
SaveChanges(SaveOptions) |
Performs an asynchronous saves of all pending changes within this EntityManager.
| |
SaveChanges(IEnumerableIEntity, SaveOptions) |
Performs an asynchronous save of just the specified entities within this EntityManager.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Properties
Name | Description | |
---|---|---|
AuthorizedThreadId | ||
CacheQueryOptions |
The CacheQueryOptions to be used when querying the local cache.
| |
ChangeNotificationEnabled |
Whether or not change notification events will be fired. This includes both EntityChange and PropertyChange events.
| |
CurrentThreadId | ||
DataService |
The default DataService for this EntityManager.
| |
DefaultQueryOptions |
Default QueryOptions for this EntityManager. These may be overriden for any specific query.
| |
DefaultSaveOptions |
Default SaveOptions for this EntityManager. These may be overriden for any specific save.
| |
KeyGenerator | ||
MetadataStore | ||
ValidationOptions |
Validation options.
|
Events
Name | Description | |
---|---|---|
EntityChanged |
Fired whenever an entity's state has changed in any significant manner.
| |
EntityChanging |
Fired whenever an entity's state is changing in any significant manner.
| |
HasChangesChanged |
See Also