[]
        
(Showing Draft Content)

C1.Data.ClientScope.AddRef

AddRef Method

AddRef(object)

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

Declaration
public void AddRef(object entity)
Parameters
Type Name Description
object entity

An entity to be marked as needed.

Remarks

Client views and C1DataSource classes mark entities as needed automatically. Use this method only when you fetch entities using other means, bypassing Studio for EF classes with direct access to the underlying object context. When you no longer need those entities, call Release(object). AddRef and Release are counting, every AddRef call must be balanced by a Release call.

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.

Declaration
public void AddRef(Type entityType)
Parameters
Type Name Description
Type entityType

An entity type to mark as needed.