Build a minimal ASP.NET Core Web API to manage notes.
You may use AI tools to assist, but your code must run and meet all requirements.
- POST /notes → Add a new note
- Title: required, max 100 chars
- Content: optional
- CreatedAt: auto-set
- GET /notes → List all notes
- GET /notes/{id} → Get a note by ID
- DELETE /notes/{id} → Delete a note
- .NET 6+ or 7+
- ASP.NET Core Web API
- Entity Framework Core InMemory database
- Proper HTTP status codes:
- 201 Created (new note)
- 200 OK (get/delete)
- 404 Not Found (missing note)
- 400 Bad Request (validation errors)
- PUT /notes/{id} → Update a note
- Filtering in
GET /notesby keyword - Swagger/OpenAPI documentation
Request
{
"title": "First Note",
"content": "This is my first note."
}Response – 201 Created
{
"id": 1,
"title": "First Note",
"content": "This is my first note.",
"createdAt": "2025-08-13T14:35:22Z"
}Response – 200 OK
[
{
"id": 1,
"title": "First Note",
"content": "This is my first note.",
"createdAt": "2025-08-13T14:35:22Z"
}
]Response – 404 Not Found
{
"message": "Note not found."
}Response – 200 OK
{
"message": "Note deleted successfully."
}dotnet restore
dotnet run
OR
Use visual studio RUN
API will run at:
https://localhost:xxxx
Swagger (if enabled):
https://localhost:xxxx/swagger