This project is a simple RESTful API for a bookstore, built using ASP.NET Core and Entity Framework Core. The API allows you to perform CRUD operations on books, such as creating, reading, updating, and deleting book records.
- URL:
/api/books
- Method:
GET
- Success Response:
- Code:
200 OK
- Content: List of books
- Code:
- URL:
/api/books/{id}
- Method:
GET
- URL Parameters:
id
(string) - Success Response:
- Code:
200 OK
- Content: Book object
- Code:
- Error Response:
- Code:
404 Not Found
- Code:
- URL:
/api/books
- Method:
POST
- Data Parameters: JSON object representing the book
- Example:
{"Id": "1", "Title": "Book Title", "Author": "Book Author", "Price": 9.99}
- Example:
- Success Response:
- Code:
201 Created
- Content: Created book object
- Code:
- Error Response:
- Code:
409 Conflict
if the book with the specified ID already exists
- Code:
- URL:
/api/books/{id}
- Method:
PUT
- URL Parameters:
id
(string) - Data Parameters: JSON object representing the updated book
- Example:
{"Id": "1", "Title": "Updated Title", "Author": "Updated Author", "Price": 19.99}
- Example:
- Success Response:
- Code:
204 No Content
- Code:
- Error Response:
- Code:
400 Bad Request
if the book ID in the URL and body do not match - Code:
404 Not Found
if the book with the specified ID is not found
- Code:
- URL:
/api/books/{id}
- Method:
DELETE
- URL Parameters:
id
(string) - Success Response:
- Code:
204 No Content
- Code:
- Error Response:
- Code:
404 Not Found
if the book with the specified ID is not found
- Code: