A Demo Event API built with .NET Core, leveraging essential technologies such as Entity Framework Core, Redis, MediatR, and XUnit. The API implements CRUD operations following clean architecture principles, applying CQRS with MediatR for command and query separation. It includes extensive integration and unit tests.
Before running the Event API, ensure that you have the following prerequisites installed:
- .NET Core SDK
- Redis
- Docker (optional)
-
Clone the repository:
git clone https://github.com/AdabanyaChinedu/EventService.git -
Navigate to the project directory:
cd EventService -
Build the project using the following command:
dotnet build
-
Run the application using the following command:
dotnet runThe API will start running at
http://localhost:5000. -
Access the API endpoints using a tool like Postman or a web browser. Refer to the API Endpoints section for more details.
The Event API provides the following endpoints:
- `GET /api/v1/events` - Get all events (paginated).
- `GET /api/v1/events/{id}` - Get an event by ID.
- `POST /api/v1/events` - Create a new event.
- `PUT /api/v1/events/{id}` - Update an existing event.
- `DELETE /api/v1/events/{id}` - Delete an event.
For detailed information on the request and response formats, please refer to the API documentation available at http://localhost:5000/swagger when the
application is running.
The project includes extensive integration and unit tests to ensure the correctness of the implementation. To run the tests, follow these steps:
-
Navigate to the project directory (if you're not already there):
cd EventService -
Run the tests using the following command:
dotnet test
This command will execute the unit tests and display the test results in the console.