How omaradel320/cqrs works
ProductCatalog is a small ASP.NET Core product CRUD API. HTTP endpoints in Program dispatch MediatR queries and commands; handlers perform product reads and writes through an EF Core SQLite context. Product and command/query models define the data exchanged, with AutoMapper configured for product mappings. Handler details for create and delete were not excerpted, so their database interactions are shown only where the source index confirms references; no separate integrations are documented.
Main entry points: Program.cs Product endpoints · ProductDBContext.cs EF context · Product.cs Product model · MappingProfile.cs Product mappings
Components 16
HTTP API
- Product endpoints
ProductCatalog/Program.cs
CQRS operations
- Create command
ProductCatalog/Resources/Commands/Create/CreateProductCommand.cs - Create handler
ProductCatalog/Resources/Commands/Create/CreateProductCommandHandler.cs - Update command
ProductCatalog/Resources/Commands/Update/UpdateProductCommand.cs - Update handler
ProductCatalog/Resources/Commands/Update/UpdateProductCommandHandler.cs - Delete command
ProductCatalog/Resources/Commands/Delete/DeleteProductCommand.cs - Delete handler
ProductCatalog/Resources/Commands/Delete/DeleteProductCommandHandler.cs - List query
ProductCatalog/Resources/Queries/GetAllProductQuery.cs - List handler
ProductCatalog/Resources/Queries/GetAllProductQueryHandler.cs - Product query
ProductCatalog/Resources/Queries/GetProductByIdQuery.cs - Product handler
ProductCatalog/Resources/Queries/GetProductByIdQueryHandler.cs
Product data
- Product mappings
ProductCatalog/MappingProfile.cs - Product model
ProductCatalog/Models/Product.cs - EF context
ProductCatalog/Data/ProductDBContext.cs - SQLite database
ProductCatalog/products.db
Other components
- API client
Connections 28
- API client → Product endpoints: sends HTTP
ProductCatalog/Program.cs - Product endpoints → Create command: dispatches
ProductCatalog/Program.cs - Product endpoints → Update command: dispatches
ProductCatalog/Program.cs - Product endpoints → Delete command: dispatches
ProductCatalog/Program.cs - Product endpoints → List query: dispatches
ProductCatalog/Program.cs - Product endpoints → Product query: dispatches
ProductCatalog/Program.cs - Create handler → Create command: handles
ProductCatalog/Resources/Commands/Create/CreateProductCommandHandler.cs - Update handler → Update command: handles
ProductCatalog/Resources/Commands/Update/UpdateProductCommandHandler.cs - Delete handler → Delete command: handles
ProductCatalog/Resources/Commands/Delete/DeleteProductCommandHandler.cs - List handler → List query: handles
ProductCatalog/Resources/Queries/GetAllProductQueryHandler.cs - Product handler → Product query: handles
ProductCatalog/Resources/Queries/GetProductByIdQueryHandler.cs - Create handler → EF context: uses
ProductCatalog/Resources/Commands/Create/CreateProductCommandHandler.cs - Update handler → EF context: uses
ProductCatalog/Resources/Commands/Update/UpdateProductCommandHandler.cs - Delete handler → EF context: uses
ProductCatalog/Resources/Commands/Delete/DeleteProductCommandHandler.cs - List handler → EF context: reads
ProductCatalog/Resources/Queries/GetAllProductQueryHandler.cs - Product handler → EF context: reads
ProductCatalog/Resources/Queries/GetProductByIdQueryHandler.cs - EF context → SQLite database: uses SQLite
ProductCatalog/Data/ProductDBContext.cs - EF context → Product model: stores
ProductCatalog/Data/ProductDBContext.cs - Create handler → Product model: uses
ProductCatalog/Resources/Commands/Create/CreateProductCommandHandler.cs - Update handler → Product model: maps
ProductCatalog/Resources/Commands/Update/UpdateProductCommandHandler.cs - Delete handler → Product model: uses
ProductCatalog/Resources/Commands/Delete/DeleteProductCommandHandler.cs - List handler → Product model: returns
ProductCatalog/Resources/Queries/GetAllProductQueryHandler.cs - Product handler → Product model: returns
ProductCatalog/Resources/Queries/GetProductByIdQueryHandler.cs - Product endpoints → EF context: registers
ProductCatalog/Program.cs - Product endpoints → Product mappings: registers
ProductCatalog/Program.cs - Product mappings → Product model: maps
ProductCatalog/MappingProfile.cs - Product mappings → Create command: maps
ProductCatalog/MappingProfile.cs - Product mappings → Update command: maps
ProductCatalog/MappingProfile.cs