A sample Web Api project with decoupled architecture which returns Traffic Monitoring data
- .Net Core 3.1
- Entity Framework Core
- Autofac
- Automapper
- nLog
- XUnit
- Moq
-
Install .Net Core Cli > 3.1 on your machine
-
Install efcore cli tools using below commands
dotnet tool install --global dotnet-ef
dotnet add package Microsoft.EntityFrameworkCore.Design
-
In your terminal window type below command
- Open Test.Api.sln in visual studio and update database connection strings in
- Test.Api -> Test.Api -> appsettings.Development.json
- Test.Infrastructure -> appsettings.json
-
Now, in your terminal window, cd into Test.Infrastructure project and type below command to create and seed database.
dotnet ef database update
-
In your visual studio, run the api using f5 key. It should open https://localhost:5001/swagger/index.html in your browser
-
Expand Monitoring tab, click Try Out button and enter Api Key. You can find it inside Test.Api -> Test.Api -> appsettings.Development.json
-
Click on Execute
-
It should show you returned json data