How berkaymehmetsert/netcore.rabbitmq works
This repository is a .NET product-management REST API with CRUD operations, database persistence, and product-creation events published to RabbitMQ. The principal flow is an HTTP request through the products controller and product manager, then to repositories and the unit of work for persistence; creation also publishes an event. Product requests, responses, and entities define the domain data. The console consumer is present, but its event-handling behavior is not shown in the excerpts, so that connection remains unverified.
Main entry points: ProductManager.cs Product Manager · ProductRepository.cs Product Repository · ProductsController.cs Products Controller · BaseDbContext.cs EF Database Context
Components 17
Product API
- Products Controller
API/Controllers/ProductsController.cs
Application and Domain
- Product Manager
API/Application/Services/ProductManager.cs - Product Service Contract
API/Application/Services/IProductService.cs - Product Requests
API/Application/Requests - Product Responses
API/Application/Responses/ProductResponse.cs - Product Entity
API/Models/Entities/Product.cs - Base Entity
API/Models/Common/BaseEntity.cs - Repository Contracts
API/Application/Repositories
Persistence
- Product Repository
API/Persistence/Repositories/ProductRepository.cs - Base Repository
API/Persistence/Repositories/BaseRepository.cs - Unit of Work
API/Persistence/Repositories/UnitOfWork.cs - EF Database Context
API/Persistence/Context/BaseDbContext.cs - Product Database
Event Messaging
- RabbitMQ Producer
API/Application/RabbitMq/RabbitMqProducer.cs - RabbitMQ
- Console Consumer
Consumer.Console/Program.cs
Other components
- HTTP Client
Connections 23
- HTTP Client → Products Controller: sends requests
API/Controllers/ProductsController.cs - Products Controller → Product Manager: calls service
API/Controllers/ProductsController.cs - Products Controller → Product Requests: accepts
API/Controllers/ProductsController.cs - Products Controller → Product Responses: returns
API/Controllers/ProductsController.cs - Product Manager → Product Repository: reads and writes
API/Application/Services/ProductManager.cs - Product Manager → Unit of Work: saves changes
API/Application/Services/ProductManager.cs - Product Manager → RabbitMQ Producer: publishes created product
API/Application/Services/ProductManager.cs - Product Manager → Product Entity: creates and updates
API/Application/Services/ProductManager.cs - Product Manager → Product Responses: maps results
API/Application/Services/ProductManager.cs - Product Manager → Product Requests: uses input
API/Application/Services/ProductManager.cs - Product Service Contract → Product Requests: accepts
API/Application/Services/IProductService.cs - Product Service Contract → Product Responses: returns
API/Application/Services/IProductService.cs - Product Repository → Base Repository: inherits
API/Persistence/Repositories/ProductRepository.cs - Product Repository → EF Database Context: uses context
API/Persistence/Repositories/ProductRepository.cs - Product Repository → Product Entity: queries
API/Persistence/Repositories/ProductRepository.cs - Unit of Work → EF Database Context: uses context
API/Persistence/Repositories/UnitOfWork.cs - EF Database Context → Product Entity: tracks
API/Persistence/Context/BaseDbContext.cs - Product Repository → Repository Contracts: implements
API/Persistence/Repositories/ProductRepository.cs - Base Repository → Repository Contracts: implements
API/Persistence/Repositories/BaseRepository.cs - Product Entity → Base Entity: inherits
API/Models/Entities/Product.cs - EF Database Context → Product Database: persists to
- RabbitMQ Producer → RabbitMQ: publishes event
README.md - RabbitMQ → Console Consumer: may deliver event