[]
Marks an entity as needed. Needed entities are not detached/released from the context until the client scope is disposed.
public void AddRef(object entity)
Type | Name | Description |
---|---|---|
object | entity | An entity to be marked as needed. |
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.
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.
public void AddRef(Type entityType)
Type | Name | Description |
---|---|---|
Type | entityType | An entity type to mark as needed. |