Feat/converting to cqrs using mediatr#12
Open
9Queens wants to merge 15 commits into
Open
Conversation
added 15 commits
July 5, 2026 13:09
…I config - Replace per-instance HttpClient with typed HttpClient via IHttpClientFactory - Remove BuildServiceProvider anti-pattern; accept IConfiguration in DefaultConfiguration - Inject HttpClient into ProductsService and make JSON deserialization null-safe with logging - Pass builder.Configuration into registration calls in Program.cs
- Add GetProductById/CreateProduct to IProductsService and ProductsService, exttending API endpoints, and include unit tests - Test project added + ProductService tests added
- Add TokenService, AuthenticationDelegatingHandler, DI wiring and memory cache - Attach Bearer token to typed HttpClients and add unit tests (token + handler)
- add PerformanceLoggingMiddleware Measure incoming request duration and log warnings when requests exceed configured threshold; support excluded paths. - add HttpClientMetricsHandler Measure outgoing HttpClient call durations and emit structured metrics/warnings based on performance settings. - register metrics handler and middleware Register HttpClientMetricsHandler and AuthenticationDelegatingHandler with typed HttpClients and add PerformanceLoggingMiddleware to pipeline. - add unit tests for performance logging and metrics Add tests for slow incoming requests and slow outgoing HttpClient calls; add TestLogger helpers and console output for visibility.
- move validators/mappers to Mapping/Validation - add upstream category mapper - DI helpers, injectable API validators - more unit tests.
- Multi-stage Dockerfile for optimized builds - Docker Compose for dev/prod/test environments - Fix TokenService HttpClient registration and auth payload - Update API configuration for correct upstream paths - Add Docker documentation - GETTING_STARTED.md file added for the readers to start operating using docker
….com/9Queens/csharpapp into feat/-add-docker-support-to-solution
…oss the solution using MediatR library to improve separation of concerns and maintainability. Architecture Changes: - Replace service-based approach with CQRS handlers - Introduce IMediator for centralized request handling - Separate read operations (Queries) from write operations (Commands) Added: - MediatR package (v14.2.0) to Application layer - Query handlers for Products (GetProducts, GetProductById) - Query handlers for Categories (GetCategories, GetCategoryById) - Command handlers for Products (CreateProduct) - Command handlers for Categories (CreateCategory)
Author
|
OK |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Convert to CQRS pattern using MediatR
Implement CQRS (Command Query Responsibility Segregation) pattern across the solution using MediatR library to improve separation of concerns and maintainability.
Architecture Changes:
Added: