Assignment Submission - .NET Developer Natlex Group Oy
Submitted by: Syed Jawad Akhtar
- Description
- API Overview
- Requirements
- Steps to run the project
- Debug
- Future Prospects of the project
- Time distribution
An ASP.NET API for Book Reservation system. A minimal API consists of book id, title, comments and status. Minimal API was chosen instead of Controller-based MVC because of the small size of the project. Swagger is implemented in it to test the REST API using user Interface. MVC-based API must be used for proper documentation and complicated APIs. Returning TypedResults instead of Results for better testability and automatically returning type metadata for OpenAPI to describe the endpoint.
API | Description | Request Body | Response body |
---|---|---|---|
GET /api/books | Get all books | None | Array of books |
GET /api/books/{id} | Get a book by ID | None | A book |
GET /api/books/reserved | List of all "reserved" books | None | Array of books |
GET /api/books/available | List of all "available" books | None | Array of books |
POST /api/books | Add a new book | Book item | Book item |
POST /api/bookitems/{id}/reserve | Reserve a book with comment | None | Book item |
POST /api/bookitems/{id}/remove-reserve | Remove a status of book | None | Book item |
PUT /api/books/{id} | Update an existing book | Book item | None |
DELETE /api/books/{id} | Delete a book item | None | None |
- Visual Studio (.NET > 5.0)
- Docker Desktop (Linux)
- Clone this repository
- Open the project in Visual Studio
- Run through Docker
If you encounter this error when starting the application:
One or more errors occured.
Failed to launch debug adapter. Additional information may be available in the output window.
The operation was canceled.
Try this Solution:
a. Faced with identical error, I was able to resolve by deleting VSDBG debugger folder: %USERPROFILE%\vsdbg\vs2017u5
b. Clean and Build
- Creating
Icollection
to store the status of the reservation of books and create an endpoint - Use a persistent database to store this information
- Shifting to controller-based API for proper code organization, internal/external documentation with swagger and proper integration of microservices.
Task | Time (hrs) |
---|---|
Understanding the tasks | 1.5 |
Learning about ASP.NET, Entity Framework (EF) Core Basics, Razor pages, etc | 3.5 |
Completing the tasks with installing packages | 4 |
Documentation | 0.5 |
Total | 9.5 |