A simple CRUD (Create, Read, Update, Delete) functionality using ASP.NET Web API with a JSON file as the backend.
This project demonstrates a basic implementation of a RESTful API using ASP.NET Web API, with CRUD operations backed by a JSON file. The application manages a collection of contacts stored in a JSON file (contacts.json), providing endpoints to perform operations like fetching all items, getting a specific item by ID, creating a new item, updating an existing item, and deleting an item.
- .NET SDK installed on your machine.
- A code editor of your choice (e.g., Visual Studio, Visual Studio Code).
-
Clone the repository:
git clone https://github.com/steveebenezer/contact-manager-api.git
-
Navigate to the project directory:
cd contact-manager-api
-
Build and run the application:
dotnet build dotnet run
The API should be running at http://localhost:5000
(or a different port if specified).
-
Get All Contacts:
GET /api/contacts
-
Get Contact by Id:
GET /api/contacts/{id}
-
Create new Contact:
POST /api/contacts
-
Update Contact by Id:
PUT /api/contacts/{id}
-
Delete Contact by Id:
DELETE /api/contacts/{id}