Skip to content

Repository files navigation

IT3045C Final Project API (NET 8, EF Core, NSwag)

This is a ready-to-run template for your final project. It uses:

  • .NET 8 Web API
  • Entity Framework Core (Code-First) with SQL Server LocalDB
  • NSwag for OpenAPI/Swagger UI
  • Four controllers: TeamMembers, Hobbies, FavoriteFoods, WorkoutPlans

Quick Start (Visual Studio 2022/2025)

  1. Open the solution by opening FinalProjectAPI.csproj in Visual Studio.
  2. Open Package Manager Console (Tools → NuGet Package Manager → Package Manager Console)
  3. Run EF Core migrations:
    Add-Migration InitialCreate
    Update-Database
  4. Press F5 to run. Browser should open at /swagger.
  5. Test CRUD endpoints in Swagger UI. GET /api/TeamMembers/{id?} returns first 5 when id is null or 0.

Nullable id behavior

Each GET {id?} endpoint accepts a nullable id. When id is null or 0, it returns the first 5 items. Otherwise it returns the entity by id or 404.

Seeding

On startup, after migrations, the app seeds sample rows if the tables are empty.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages