Skip to content

mohamedabotir/CQRSWrapper-standard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CQRSWrapper

structure of pattern file structure

Command

  • Entity inherit from ICommand interface example UserCommand:ICommand
  • handler should inherit from ICommandHandler Example UserCommandHandler:ICommandHandler write what you want to handler make
  • you should inject your handler example : builder.Services .AddTransient<ICommandHandler, UserCommandHandler>();

Query

  • Entity inherit from IQuery interface example GetUserList : IQuery
  • handler should inherit from IQueryHandler<Entity, EntityModel>> Example : GetUserListHandler : IQueryHandler<GetUserList, UserDTO> write what you want to handler make
  • you should inject your handler example : builder.Services .AddTransient<IQueryHandler<GetUserList, UserDTO>, GetUserListHandler>();

inject cqrs service

you should inject cqrs service as this manager of pattern and by this can ship your service example builder.Services.AddSingleton();

About

this repo is a simple solution to help user to implement CQRS

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages