By: Albin Rönnkvist
- VS Code with the following extensions:
- ms-dotnettools.csharp
- jchannon.csharpextensions
- .NET 6.0 SDK
- ASP.NET Core Web API
- EF Core
- SQL Server
- SQL Server Management Studio (SSMS)
- Clone repo: git clone https://github.com/albinronnkvist/ForumAPI
- Configure EF Core and add a database connection:
- Create a database connection using SSMS.
- Add the database connection string to appsettings.json or in a user-secret:
"ConnectionStrings": { "DefaultConnection": "Data Source=(localdb)\\MSSQLLocalDB; Initial Catalog={db_name}; User ID={db_username}; Password={db_password};" }
- Install EF tools: dotnet tool install --global dotnet-ef
- Run the EF Core migrations: dotnet ef database update
- Add a signing key to appsettings.json or in a user-secret:
"TokenSettings": {
"SigningKey": "{your_secure_signing_key_with_atleast_16_characters}"
}
- Run the application: dotnet run
- Test the application with Swagger: https://localhost:7177/swagger/index.html
- Video demo: https://www.youtube.com/watch?v=-3N8dx2N0Cc
- Documentation: https://albinronnkvist.se/skola/dt071g/Rapport.pdf