[]
        
(Showing Draft Content)

C1.Data.ClientCacheBase

ClientCacheBase Class

Represents the client-side cache, the central hub of data access in the Studio for Entity Framework.

Inheritance
ClientCacheBase
Namespace: C1.Data
Assembly: C1.Data.Entity.4.8.dll
Syntax
public abstract class ClientCacheBase : IDisposable, INotifyPropertyChanged
Remarks

Usually, a single instance of this class is created on application startup with an ObjectContext/DomainContext as a parameter and exists during the entire application lifetime, while each form, window, or user control works with data using a ClientScope created by calling the CreateScope() method.

It is the base class for platform-specific implementations, such as C1.Data.Entities.EntityClientCache (Entity Framework), C1.Silverlight.Data.RiaServices.RiaClientCache (RIA Services).

Methods

Name Description
BulkChanges(Action)

Used to group massive changes to entities and to allow manual explicit changes of entity states.

CleanupCache()

Forces unused memory to be released, unused entities to be detached from the context. It is usually done automatically, so programmers rarely need to call this method in code.

Clear()

Clears client-side cache entirely. Call this method if you want to make sure that following queries will fetch fresh data from the server.

CreateScope()

Creates a ClientScope that defines a scope of data access.

CreateTransaction()

Creates a ClientTransaction that allows you to easily cancel changes made in transaction scope.

Refresh()

Refreshes data in all C1DataSource controls connected to this ClientCacheBase.

RejectChanges()

Reverts all pending changes for this ClientCacheBase. It is recommended to call this method instead of System.Data.Objects.ObjectContext.Refresh(System.Data.Objects.RefreshMode, object).

SaveChanges()

Persists all changes to the server. It is recommended to call this method instead of System.Data.Objects.ObjectContext.SaveChanges().