ComponentOne Data Source for Entity Framework
C1.Data Namespace / ClientScope Class / AddRef Method / AddRef(Object) Method
An entity to be marked as needed.

In This Topic
    AddRef(Object) Method
    In This Topic
    Marks an entity as needed. Needed entities are not detached/released from the context until the client scope is disposed.
    Syntax
    'Declaration
     
    
    Public Overloads Sub AddRef( _
       ByVal entity As System.Object _
    ) 
    public void AddRef( 
       System.object entity
    )

    Parameters

    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.
    See Also