A production-ready ASP.NET Core Web API template built with Dapper, SQL Server, ASP.NET Core Identity, FluentMigrator, JWT authentication, and a clean separation between presentation, services, and data access.
The demo is hosted on Microsoft Azure and can be used to explore the deployed API.
- ⚡ ASP.NET Core 9 Web API
- 🗄️ Dapper Micro-ORM
- 🔐 ASP.NET Core Identity with Dapper
- 🔑 JWT Authentication
- 🧩 FluentMigrator
- 🛢️ SQL Server
- 📋 Swagger / OpenAPI
- 🏗️ Clean Architecture
- 📦 Repository & Service patterns
- 🔎 Filtering, searching, sorting & pagination
- 🪵 Centralized logging
- 🔄 Dependency Injection
- 🚀 Ready for enterprise applications
| Technology | Purpose |
|---|---|
| .NET 9 | Application framework |
| ASP.NET Core | Web API |
| Dapper | Data access |
| SQL Server | Database |
| FluentMigrator | Database migrations |
| ASP.NET Core Identity | Authentication & authorization |
| JWT | API authentication |
| Swagger | API documentation |
The application requires the SECRET environment variable.
setx SECRET "RFKSolutionsSecretKey2026EswatiniEmployees256BitSecure!" /MRestart your terminal or Visual Studio after running the command.
export SECRET="RFKSolutionsSecretKey2026EswatiniEmployees256BitSecure!"For production, use a secure secret-management solution rather than storing secrets directly in source control.
Open:
src/RFK/appsettings.json
Configure your database connection:
{
"ConnectionStrings": {
"sqlConnection": "Server=.;Database=RFKDb;Trusted_Connection=True;TrustServerCertificate=True;"
}
}Make sure SQL Server is running and accessible.
From the repository root:
dotnet restore
dotnet build
dotnet run --project src/RFKFluentMigrator will create the application database and run the available migrations.
If the application reports missing Identity tables such as:
AspNetUsers
AspNetRoles
AspNetUserRoles
AspNetUserClaims
AspNetRoleClaims
Important: Ensure you stop the application before executing these steps to prevent database locks or active connection errors.
-
Stop the Application
- Terminate all running instances of the application in your IDE.
-
Open SQL Server Management Studio (SSMS) and connect to your SQL Server instance and Select the Target Database**
- Choose one of the following methods to load the script:
- Method A: Open the
IdentityTablesfile located in the project's root folder, copy the entire SQL script, and paste it into a New Query window (Ctrl + N) in SSMS. - Method B: Select File > Open > File... in SSMS and select
IdentityTables.sqldirectly.
- Method A: Open the
- Choose one of the following methods to load the script:
-
Execute the Script
- Click the Execute button in the toolbar (or press F5) to run the script.
- Confirm that the output window displays
Commands completed successfully.
Start the application again:
dotnet run --project src/RFKOpen Swagger using the HTTPS URL shown in the application output:
https://localhost:<port>/swagger
| Property | Value |
|---|---|
| Username | admin |
| Password | Password123! |
Change the default password before using the application in a production environment.
After logging in, copy the JWT token and use Authorize in Swagger:
Bearer <your-token>
RFK.Solutions/
│
├── .github/
│ └── workflows/
│
├── src/
│ ├── AspNetCore.Identity.Dapper/
│ ├── Contracts/
│ ├── Entities/
│ ├── LoggerService/
│ ├── Repository/
│ ├── RFK/
│ ├── RFK.Presentation/
│ ├── Service/
│ ├── Service.Contracts/
│ └── Shared/
│
├── IdentityTables
├── LICENSE
├── README.md
└── RFK.sln
| Project | Responsibility |
|---|---|
AspNetCore.Identity.Dapper |
Dapper-based ASP.NET Core Identity stores |
Contracts |
Repository and data-access contracts |
Entities |
Domain models, DTOs and Identity entities |
LoggerService |
Centralized logging |
Repository |
Dapper queries, repositories and stored procedures |
RFK |
API host, configuration and dependency injection |
RFK.Presentation |
API controllers and HTTP endpoints |
Service |
Business logic and application services |
Service.Contracts |
Service interfaces |
Shared |
Common models, paging, filtering, searching and sorting |
Swagger provides interactive API documentation and testing.
https://localhost:<port>/swagger
This project is licensed under the MIT License.