This is a clean, modular .NET 8 API project using:
- Entity Framework Core 9
- Repository & Service Pattern
- SQL Server with customizable schema
- Layered architecture (Data, Repo, Service, Web)
OA.Web => API entry point (ASP.NET Core)
OA.Service => Business logic / Service Layer
OA.Repo => Data access / Repositories + DbContext
OA.Data => Models / Entities / BaseEntity
- Uses
ApplicationContext
for centralized EF Core configuration - Separation of concerns with interfaces and dependency injection
git clone https://github.com/markdicks/Test_API.git
cd Test_API
Copy appsettings.json
to a local override version:
cp appsettings.json appsettings.Development.json
Then edit appsettings.Development.json
:
{
"ConnectionStrings": {
"DefaultConnection": "Server=.;Database=TestDb;Trusted_Connection=True;TrustServerCertificate=True;"
}
}
🔐 Never commit
appsettings.Development.json
– it contains sensitive info.
Migrations are kept under version control for shared schema management.
To add a new migration (using Package Manager Console):
Add-Migration <name_of_migration>
To apply migrations:
Update-Database
cd OA.Web
dotnet run
The API will start on:
https://localhost:5001
# Local secrets & sensitive configs
appsettings.Development.json
# Migrations (Comment out if you want to keep them)
OA.Repo/Migrations/*
- Follows SOLID principles and clean architecture practices
- Migrations use schema prefixing (
Test_
) for namespace isolation - DI setup via
builder.Services.AddScoped
andAddTransient
based on service lifetimes - OA stands for "Onion Architecture"
Microsoft.EntityFrameworkCore
(9.0.4)Microsoft.EntityFrameworkCore.SqlServer
Microsoft.EntityFrameworkCore.Tools
MIT © Mark Dicks