public static Task <IEntity> GetById(this IEntityService entityService, IEntityDefinition entityDefinition, object id, CancellationToken ct) { entityService.NotNull(nameof(entityService)); entityDefinition.NotNull(nameof(entityDefinition)); id.NotNull(nameof(id)); return(entityService.CreateQuery(entityDefinition).Add(Criterion.IdEq(id)).UniqueResult <IEntity>(ct)); }