dotnet application structure

graph TD
subgraph Application
Commands
CommandHandlers
Queries
QueryHandlers
end

subgraph Infrastructure
DbContext
end

subgraph Domain
Entities
end

subgraph Service
Controllers
end

subgraph EventHandler
EventHandlers
end

subgraph External
Events
API[HTTP Requests]
end

db[(Postgresql)]
Events-.->EventHandlers
API<-->Controllers
CommandHandlers-.->|produces|Events
Controllers & EventHandlers-->|use|Commands
Controllers<-->|use|Queries
Commands-->|to execute|CommandHandlers
CommandHandlers & QueryHandlers-->|read from|DbContext
CommandHandlers & QueryHandlers-->|use|Entities
CommandHandlers-->|write to|DbContext
Queries<-->|to search|QueryHandlers

DbContext<-->db