ASP .NET Core Project for learning. Every one should be able to use this templae to build a ASP .NET Core web API with PostgreSQL database.
- Student's API (ADD, UPDATE, DELETE, GET)
- Entity Framework Core
- Swagger for API's Endpoint
- API-Versioning
- Serial-Log
- AutoMapper
These instructions will get you to setup the project, install sdk and add package (CLI or Package manager console).
- Visual Studio 2022 or higher
- .NET 7.x SDK
- Npgsql.EntityFrameworkCore.PostgreSQL 7.0.11 (https://www.nuget.org/packages/Npgsql.EntityFrameworkCore.PostgreSQL/)
- Install .net SDK 7
Download .NET SDK here. - Create new Web API's project
dotnet new webapi –-name API
- Add package
- Entity Framework Core 7.0.13
dotnet add package Microsoft.EntityFrameworkCore -v 7.0.13
dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL -v 7.0.11
- API-Versioning
dotnet add package Asp.Versioning.Mvc.ApiExplorer -v 7.1.0
- Serial-Log
dotnet add package Serilog.AspNetCore
- AutoMapper
dotnet add package AutoMapper.Extensions.Microsoft.DependencyInjection
- Entity Framework Core 7.0.13
- Migrate Model to Database
- Command Line
Add Migrationdotnet ef migrations add AddStudentToDB
Update to DBdotnet ef database update
- Package Manager Console
Add Migrationadd-migration AddStudentToDB
Update to DBupdate-database
- Command Line