Skip to content
This repository has been archived by the owner on Jul 7, 2024. It is now read-only.

Queries and Commands generator in CQRS pattern using MediatR, and AutoMapper

License

Notifications You must be signed in to change notification settings

God0nlyKnows/CQRS-Source-Generator

Repository files navigation

CQRS Source Generator

It's a Queries and Commands generator in CQRS pattern using MediatR, ErrorOr and AutoMapper

Goals

  • Generating Queries and Commands
  • Adjusting generated classes trough attributes
  • Making low-level improvments to make generator fast and lightweight
  • Deploying package on NuGet
  • Snapshot tests and benchmarks
  • Enable caching and ignore unchanged files

Example usage

    [GenerateQueries]
    [GenerateCommand(Method: "Create", DTO: typeof(AddClientCommand), MapperConfig: mapperConfig)]
    public interface IClientRepository
    {
        Task<Client> Create(ClientId clientId, string name, string surname, string email);
        Task<IReadOnlyList<Client>> GetAll();
        Task<Client> Get(ClientId id);
        Task Update(Client client);
        Task Delete(ClientId id);
        Task Add(Client client);

    }
}

About

Queries and Commands generator in CQRS pattern using MediatR, and AutoMapper

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages