Skip to content
anton-martyniuk edited this page Oct 26, 2022 · 3 revisions

The following Modern CQRS Commands and Queries are available:

  • Commands and Queries without Cache
  • Commands and Queries with Cache
  • In Memory Commands and Queries

Queries are used to query data from the repository.
Commands are used to insert, update, delete data in the repository.

CQRS with Cache return data from the cache when using GetByIdQuery, TryGetByIdQuery queries.
Create, update, delete commands with Caching support - add items into cache, update and delete them accordingly.

In Memory CQRS provides commands to query data from the in-memory cache. In-memory Commands provides methods to insert, update, delete data in the repository and in the in-memory cache.

CQRS has the following Queries:

GetAllQuery<TEntityDto, TId>() : IRequest<List<TEntityDto>>

GetByIdQuery<TEntityDto, TId>(TId Id) : IRequest<TEntityDto>

TryGetByIdQuery<TEntityDto, TId>(TId Id) : IRequest<TEntityDto?>

GetCountAllQuery<TEntityDto, TId> : IRequest<long>

GetCountQuery<TEntityDbo, TId>(Expression<Func<TEntityDbo, bool>> Predicate) : IRequest<long>

GetExistsQuery<TEntityDbo, TId>(Expression<Func<TEntityDbo, bool>> Predicate) : IRequest<bool>

GetFirstOrDefaultQuery<TEntityDto, TEntityDbo, TId>(Expression<Func<TEntityDbo, bool>> Predicate) : IRequest<TEntityDto?>

GetSingleOrDefaultQuery<TEntityDto, TEntityDbo, TId>(Expression<Func<TEntityDbo, bool>> Predicate) : IRequest<TEntityDto?>

GetWhereQuery<TEntityDto, TEntityDbo, TId>(Expression<Func<TEntityDbo, bool>> Predicate) : IRequest<List<TEntityDto>>

GetWherePagedQuery<TEntityDto, TEntityDbo, TId> : IRequest<PagedResult<TEntityDto>>

CQRS has the following Commands:

CreateEntityCommand<TEntityDto>(TEntityDto Entity) : IRequest<TEntityDto>

CreateEntitiesCommand<TEntityDto>(List<TEntityDto> Entities) : IRequest<List<TEntityDto>>

UpdateEntityCommand<TEntityDto, TId>(TId Id, TEntityDto Entity) : IRequest<TEntityDto>

UpdateEntityByActionCommand<TEntityDto, TId>(TId Id, Action<TEntityDto> UpdateAction) : IRequest<TEntityDto>

UpdateEntitiesCommand<TEntityDto>(List<TEntityDto> Entities) : IRequest<List<TEntityDto>>

DeleteEntityCommand<TId>(TId Id) : IRequest<bool>

DeleteEntitiesCommand<TId>(List<TId> Ids) : IRequest<bool>

DeleteAndReturnEntityCommand<TEntityDto, TId>(TId Id) : IRequest<TEntityDto>
Clone this wiki locally