The application consists of two projects:
- Frontend:
audit-history-frontend
in React, used to pass parameters to the API and display paginated results. - Backend:
AuditHistoryApp
in ASP.NET Core, providing an API based on a layered architecture (Controller → Service → Repository → Database).
- Repository Layer: Reads data from the database and maps it to models.
- Service Layer: Transforms models into DTOs returned by the API.
- Design Patterns:
- Repository: Isolates data access logic.
- Strategy: Different interface implementations registered via KeyedServices (e.g.,
IAuditService
,IAuditRepository
). - Dependency Injection: Registers services and injects dependencies.
- DTO: Transfers data between layers.
- Decorator: Implements pagination via the
PaginatedResponse<T>
class.
- Async Programming (
async/await
) for non-blocking operations. - Optimized SQL queries in EF Core (e.g., reduced joins).
- EF Core with
AsNoTracking()
for read-only queries and protection against SQL injection. - Transactions to ensure data consistency between database queries.
- Two services fetching data with different EF Core query variants. Default service:
AuditService
.
- API interaction via browser HTTP.
- Paginated result display.
- Swagger: Available at http://localhost:5137/swagger/index.html.
- Available in the
AuditHistoryApp.Tests
project.
BenchmarkAuditHistoryApp
project to test processing times of EF Core query variants.- Average times:
AuditService
(98.59 ms) vs.SecondAuditService
(297.12 ms).
To run the application, use the following commands:
Backend StartBackend.bat
Frontend StartFrontend.bat
Benchmark StartBenchmark.bat
The application requires .NET 9.0.