A simple example restful api project in dotnet core.
From root folder:
Add-Migration <name> -o Data/Migrations
Update-Database
- Authentication with bearer tokens
- Role based authentication decorators
- Memory caching
- Todo, User, Role and UserRoles tables.
- MS SQL server database
- Swagger
- Dependency injection
- 100% coverage in all layers
- 100% coverage in integration test
There is a static auto generated Swagger documentation here and the path /swagger
also contains a non-static one.
Test type | Count |
---|---|
Utils | 10 |
Models | 44 |
Service | 33 |
Controller | 27 |
Integration | 54 |
Total | 168 |
Update database connection string
Run migrations
cd TodoApi
dotnet ef migrations add init -o Data/Migrations
dotnet ef database update
Test
dotnet run
http://localhost:5000/swagger