Upload files to "/"
update readme.md
هذا الالتزام موجود في:
92
README.md
92
README.md
@@ -1 +1,91 @@
|
|||||||
# WebApplication1
|
# WondersAPI 🏛️
|
||||||
|
|
||||||
|
A RESTful API built with ASP.NET Core to manage a collection of historical wonders. It provides full CRUD (Create, Read, Update, Delete) functionality and an endpoint to fetch a random wonder from the database.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
* **List all wonders:** Get a complete list of all wonders in the database.
|
||||||
|
* **Get a specific wonder:** Retrieve a single wonder by its unique ID.
|
||||||
|
* **Get a random wonder:** Fetch a random wonder.
|
||||||
|
* **Create, Update, and Delete:** Full support for managing wonder entries.
|
||||||
|
* **Structured Logging:** Captures detailed logs for requests, operations, and errors.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
### Running the API
|
||||||
|
|
||||||
|
Use the following command to launch the project. The API will be available at the URLs specified in the launch profile (e.g., `https://localhost:7247`).
|
||||||
|
|
||||||
|
```bash
|
||||||
|
dotnet run
|
||||||
|
```
|
||||||
|
|
||||||
|
### Running Tests
|
||||||
|
|
||||||
|
This project includes a test script. To execute the tests, run the following command from the root directory:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
dotnet test
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## API Endpoints
|
||||||
|
|
||||||
|
The base URL for all endpoints is `/api/wonders`.
|
||||||
|
|
||||||
|
| Method | Endpoint | Description |
|
||||||
|
| :----- | :-------------------------- | :----------------------------------------- |
|
||||||
|
| `GET` | `/` | Retrieves a list of all wonders. |
|
||||||
|
| `GET` | `/{id}` | Retrieves a single wonder by its ID. |
|
||||||
|
| `POST` | `/` | Creates a new wonder. |
|
||||||
|
| `PUT` | `/{id}` | Updates an existing wonder. |
|
||||||
|
| `DELETE` | `/{id}` | Deletes a wonder by its ID. |
|
||||||
|
| `GET` | `/random` | Retrieves a random wonder from the list. |
|
||||||
|
|
||||||
|
|
||||||
|
#### Example: Create a new wonder
|
||||||
|
|
||||||
|
`POST /api/wonders`
|
||||||
|
|
||||||
|
**Request Body:**
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"name": "Great Pyramid of Giza",
|
||||||
|
"country": "Egypt",
|
||||||
|
"era": "Ancient",
|
||||||
|
"type": "Tomb",
|
||||||
|
"description": "The oldest and largest of the three pyramids in the Giza pyramid complex.",
|
||||||
|
"discoveryYear": -2560
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Success Response (`201 Created`):**
|
||||||
|
|
||||||
|
The API will return the newly created wonder object, including its server-generated ID.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"name": "Great Pyramid of Giza",
|
||||||
|
"country": "Egypt",
|
||||||
|
"era": "Ancient",
|
||||||
|
"type": "Tomb",
|
||||||
|
"description": "The oldest and largest of the three pyramids in the Giza pyramid complex.",
|
||||||
|
"discoveryYear": -2560
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Technologies Used 🔧
|
||||||
|
|
||||||
|
* **Framework:** ASP.NET Core 8
|
||||||
|
* **Architecture:** RESTful API with standard controller patterns
|
||||||
|
|
||||||
|
---
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم