Skip to content

Instantly share code, notes, and snippets.

@darjanbogdan
Last active August 25, 2019 08:49
Command & Query Domain - Introduction - CQS interfaces
// Each action which mutates Domain's state implements this interface
public interface ICommandHandler<TCommand>
{
void Handle(TCommand command);
}
// Each action which queries the Domain implements this interfaces
public interface IQuery<TResult> { }
public interface IQueryHandler<TQuery, TResult> where TQuery : IQuery<TResult>
{
TResult Handle(TQuery query);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment