This and a demonstration API for managing Christmas gifts
In this project I built a REST CRUD API from scratch, using .NET 6. As you would expect, the backend system supports Creating, Reading, Updating and Deleting Christmas gifts.
- .NET6
- FluentValidation
- Swagger
The ChristmasWishList project will open up the Swagger UI once it starts. Here you can browse the documentation for each endpoint, making it easy to test all of the endpoints.
GET /gifts
200 Ok
{
"total": 1,
"totalAmount": 40
"totalSpent": 0,
"totalToSpent": 40,
"result": [
{
"id": "e6a9bc8a-4707-4e1a-8380-7541ea0f1a4a",
"firstName": "string",
"nameGift": "string",
"price": 1,
"isPurchased": false,
"createdDate": "2022-12-13T09:22:07.8675507+01:00",
"lastModifiedDate": null
}
]
}
GET /gifts/{id}
200 Ok
or
404 Not Found
{
"id": "e6a9bc8a-4707-4e1a-8380-7541ea0f1a4a",
"firstName": "John",
"nameGift": "Book C# 11 and .NET 7",
"price": 40,
"isPurchased": false,
"createdDate": "2022-12-13T09:22:07.867550+01:00",
"lastModifiedDate": null
}
POST /Gifts
{
"firstName": "John",
"nameGift": "Book C# 11 and .NET 7",
"price": 40,
"isPurchased": false,
}
201 Created
Location: {{url}}/Breakfasts/{{id}}
or
400 Bad Request
PUT /gifts/{{id}}
{
"firstName": "John",
"nameGift": "Book C# 11 and .NET 7",
"price": 40,
"isPurchased": true,
}
204 No Content
or
404 Not Found
or
400 Bad Request
DELETE /gifts/{{id}}
204 No Content
or
404 Not Found
or
400 Bad Request
DELETE /gifts/
204 No Content
or
400 Bad Request