[]
        
(Showing Draft Content)

C1.Data.ClientScope

ClientScope Class

Defines a scope of data access. Provides facilities to create client views.

Inheritance
ClientScope
Implements
Namespace: C1.Data
Assembly: C1.Data.Entity.4.8.dll
Syntax
public class ClientScope : IDisposable
Remarks

Usually, one scope is created per form/window. Entities pinned to the scope (marked as needed) are not evicted from the cache until the scope is disposed or collected by the garbage collector.

This class is a base class for platform-specific scopes, such as C1.Data.Entities.EntityClientCache (Entity Framework) and C1.Silverlight.Data.RiaServices.RiaClientCache (RIA Services).

Constructors

Name Description
ClientScope(ClientCacheBase)

Initializes a new instance of ClientScope class with the given ClientCacheBase.

Properties

Name Description
ClientCache

Gets the ClientCacheBase to which this client scope is connected.

Methods

Name Description
AddRef(object)

Marks an entity as needed. Needed entities are not detached/released from the context until the client scope is disposed.

AddRef(Type)

Mark all entities of a given type as needed. All entities of that type will not be detached from the context until the client scope is disposed.

Dispose()

Marks the scope as disposed. Entities that were marked needed by a disposed scope may be disposed of (evicted from the cache, detached from context) unless they are needed by other active scopes.

Release(object)

Unmark a needed entity.

Release(Type)

Unmark a needed entity type. Calling this method does not release memory.