Click or drag to resize
RepositoryE, KGetAsync Method
Gets a entity with key from the database.

Namespace: LiteRepository
Assembly: LiteRepository (in LiteRepository.dll) Version: 2.0.4
Syntax
C#
public virtual Task<E> GetAsync(
	K key
)

Parameters

key
Type: K
Key of the entity.

Return Value

Type: TaskE
A task representing the asynchronous operation.
Examples

For getting the entity by it's key:

C#
var key = new EntityKey { Id = 12 };
var entity = await repository.GetAsync(entity);
See Also