An enterprise-grade, decoupled Help Desk Ticket Management System architected using ASP.NET Core Web API, ASP.NET Core MVC, Entity Framework Core, SQL Server, and xUnit with Moq. Built strictly adhering to SOLID design principles, Async/Await patterns, and Dependency Injection.
| Specification Metric | Implementation Details |
|---|---|
| Solution Architecture | N-Tier / Decoupled Repository Pattern & Typed HTTP Service |
| Target Framework | .NET 10.0 (C# 13 Language Features) |
| Persistence / ORM | Entity Framework Core 10 (DbContext, Code-First Migrations) |
| Database Server | Microsoft SQL Server LocalDB ((localdb)\mssqllocaldb) |
| API Architecture | RESTful HTTP/JSON Service ([ApiController]) |
| Front-End Stack | ASP.NET Core MVC + Razor Engine + Bootstrap 5 |
| HTTP Client Client | Typed HttpClient via AddHttpClient<ITicketApiService, TicketApiService> |
| Quality Assurance | 21 Automated xUnit Unit Tests (Moq + EF Core InMemory) |
| Code Coverage | 100% Core Repository & API Controller Execution Paths |
graph TD
subgraph Presentation Layer [HelpDesk.Mvc]
UI[Razor Views / Bootstrap 5] --> MVC[TicketsController MVC]
MVC --> HTTP[TicketApiService Typed HttpClient]
end
subgraph API & Domain Layer [HelpDesk.Api]
HTTP -- REST / HTTP JSON --> API[TicketsController Web API]
API --> REPO[TicketRepository]
REPO --> DBCTX[AppDbContext]
end
subgraph Data Storage [SQL Server]
DBCTX --> SQL[(SQL Server LocalDB / HelpDeskDb)]
end
subgraph Testing Suite [HelpDesk.Tests]
XT1[TicketRepositoryTests - EF Core InMemory]
XT2[TicketsControllerTests - Moq Mocks]
XT1 -. Validates .-> REPO
XT2 -. Validates .-> API
end
| Column Name | Data Type | Nullable | Constraints & Domain Constraints | Technical Description |
|---|---|---|---|---|
Id |
INT |
No | PRIMARY KEY IDENTITY(1,1) |
Auto-incrementing surrogate identifier |
Title |
NVARCHAR(200) |
No | MAXLENGTH(200), REQUIRED |
Concise summary title of the ticket |
Description |
NVARCHAR(MAX) |
No | REQUIRED |
Detailed description of issue or request |
Priority |
NVARCHAR(20) |
No | Domain: 'Low', 'Medium', 'High' |
Ticket priority / severity level |
Status |
NVARCHAR(20) |
No | Domain: 'Open', 'In Progress', 'Closed' |
Current ticket lifecycle status |
RaisedBy |
NVARCHAR(100) |
No | MAXLENGTH(100), REQUIRED |
User or entity who logged the ticket |
CreatedDate |
DATETIME2 |
No | UTC TIMESTAMP |
Date and time when the ticket was logged |
All endpoints communicate via application/json payload structures.
| HTTP Method | Resource Endpoint Path | Request Payload | Response Codes | Endpoint Functionality |
|---|---|---|---|---|
GET |
/api/tickets |
None | 200 OK, 500 Error |
Fetches all tickets ordered by CreatedDate DESC. |
GET |
/api/tickets/{id} |
None | 200 OK, 400 Bad, 404 Not Found |
Retrieves a single ticket by its primary key Id. |
GET |
/api/tickets/status/{status} |
None | 200 OK, 400 Bad Request |
Filters tickets matching valid status (Open, In Progress, Closed). |
POST |
/api/tickets |
Ticket JSON |
201 Created, 400 Bad Request |
Validates payload, persists ticket, returns CreatedAtAction route. |
PUT |
/api/tickets/{id} |
Ticket JSON |
200 OK, 400 Bad, 404 Not Found |
Updates ticket details following validation and ID check. |
DELETE |
/api/tickets/{id} |
None | 204 No Content, 404 Not Found |
Removes the target ticket from the database. |
The test suite in HelpDesk.Tests achieves high code coverage across the core business logic and REST endpoints.
| Test Module | Testing Strategy | Tools / Frameworks | Test Count | Status |
|---|---|---|---|---|
TicketRepositoryTests |
Database integration testing via in-memory provider | xUnit + EF Core InMemory |
9 | PASSED |
TicketsControllerTests |
Isolated REST API controller unit testing | xUnit + Moq 4.20 |
12 | PASSED |
| Total Test Suite | Comprehensive Automated Verification | xUnit + Moq + EF Core | 21 | 100% PASS |
dotnet test HelpDeskManagement.sln --logger "console;verbosity=normal"- .NET 10.0 / 9.0 SDK
- Microsoft SQL Server LocalDB (
(localdb)\mssqllocaldb) dotnet-efglobal tool (dotnet tool install --global dotnet-ef)
git clone https://github.com/RaunakSachdeva2004/HelpDeskManagement.git
cd HelpDeskManagement
dotnet restore HelpDeskManagement.slnEnsure LocalDB is active and run migrations:
sqllocaldb start MSSQLLocalDB
dotnet ef database update --project HelpDesk.Api/HelpDesk.Api.csprojStart Web API Service:
dotnet run --project HelpDesk.Api/HelpDesk.Api.csprojAPI Base URL: https://localhost:7198
Start MVC Web Client (in a separate terminal):
dotnet run --project HelpDesk.Mvc/HelpDesk.Mvc.csprojMVC Client URL: https://localhost:7112
Distributed under the MIT License. See LICENSE for more information.


