- How to install Visual Studio: https://docs.microsoft.com/en-us/visualstudio/install/install-visual-studio?view=vs-2022
- Install Dotnet SDK (.Net 6 or newest): https://dotnet.microsoft.com/en-us/download/dotnet/6.0
- Get familiar with Visual Studio: https://visualstudio.microsoft.com/vs/getting-started/ https://www.youtube.com/watch?v=1CgsMtUmVgs
- How to use git: https://try.github.io/levels/1/challenges/1
- API Testing with Postman: https://www.blazemeter.com/blog/how-use-postman-manage-and-execute-your-apis
This test is designed for students who haven't learnt AspNet.Core Web API before or just know little things about AspNet.Core Web API.
Duration: 1 week.
We need to build an application to manage book in the library. Complete the list of items bellow to pass the challenges !!! ⚔️⚔️⚔️
- Create a web API project.
- Add a model class and a database context. use
InMemory
database for testing purposes - Seeding default data (list here)
- Scaffold a controller with CRUD methods.
- Configure routing, URL paths, and return values.
- Call the web API with Postman.
- Use GitHub to manage source code
The following diagram shows the model of the app.
Create the following APIs:
Method | API | Description | Response body | Example |
---|---|---|---|---|
GET | /api/books | Get all books (Supports filtering by AuthorId, Rating, and PublishYear) | Array of book items | detail |
GET | /api/books/{id} | Get an item by ID | Book item | detail |
POST | /api/books | Add a new item | Book item | detail |
PUT | /api/books/{id} | Update an existing item | None | detail |
DELETE | /api/books/{id} | Delete an item | None | detail |
GET | /api/authors | Get list of author | Array of authors with number of books | detail |
- Add user identity and apply login with JWT
- Add custom middleware to write logs when requests take more than 500ms.