{"id":19519159,"url":"https://github.com/rahulmule/contactsapp_dotnetrestapi","last_synced_at":"2025-07-09T07:39:31.631Z","repository":{"id":215627904,"uuid":"739388377","full_name":"RahulMule/ContactsApp_DotNetRestAPI","owner":"RahulMule","description":"This repository contains a .NET Web API for managing contacts. The API allows you to perform CRUD operations (Create, Read, Update, Delete) on contacts stored in a SQL database.","archived":false,"fork":false,"pushed_at":"2024-03-02T19:52:07.000Z","size":30,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-26T00:15:26.409Z","etag":null,"topics":["docker","dot-net-core","dotnet-6","dotnetwebapi","entity-framework-core","rest-api"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RahulMule.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-01-05T12:53:11.000Z","updated_at":"2024-04-16T18:35:42.000Z","dependencies_parsed_at":"2024-01-05T14:46:37.815Z","dependency_job_id":"abba3a55-cfd0-401d-829b-1c432b814cdb","html_url":"https://github.com/RahulMule/ContactsApp_DotNetRestAPI","commit_stats":null,"previous_names":["rahulmule/contactsapp","rahulmule/contactsapp_dotnetrestapi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RahulMule/ContactsApp_DotNetRestAPI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RahulMule%2FContactsApp_DotNetRestAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RahulMule%2FContactsApp_DotNetRestAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RahulMule%2FContactsApp_DotNetRestAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RahulMule%2FContactsApp_DotNetRestAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RahulMule","download_url":"https://codeload.github.com/RahulMule/ContactsApp_DotNetRestAPI/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RahulMule%2FContactsApp_DotNetRestAPI/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264415069,"owners_count":23604537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","dot-net-core","dotnet-6","dotnetwebapi","entity-framework-core","rest-api"],"created_at":"2024-11-11T00:16:36.843Z","updated_at":"2025-07-09T07:39:31.612Z","avatar_url":"https://github.com/RahulMule.png","language":"C#","readme":"# Contacts App Web API\n\nThis repository contains a .NET Web API for managing contacts. The API allows you to perform CRUD operations (Create, Read, Update, Delete) on contacts stored in a database.\n\n## Project Structure\n\nThe project structure follows a typical ASP.NET Web API pattern, utilizing Entity Framework Core for database interaction.\n\n- **Controllers:**\n  - `ContactsController`: Manages CRUD operations for contacts.\n\n- **Data:**\n  - `ContactsAppDbContext`: Entity Framework DbContext for handling contact data.\n\n- **Models:**\n  - `Contact`: Represents a contact entity.\n\n## API Endpoints\n\n### 1. Get All Contacts\n\n- **Endpoint:** `GET /api/Contacts`\n- **Description:** Retrieve a list of all contacts.\n- **Response:** Array of contacts.\n\n### 2. Get Contact by ID\n\n- **Endpoint:** `GET /api/Contacts/{id}`\n- **Description:** Retrieve a specific contact by ID.\n- **Response:** Single contact or NotFound if not found.\n\n### 3. Update Contact\n\n- **Endpoint:** `PUT /api/Contacts/{id}`\n- **Description:** Update an existing contact.\n- **Request Body:** JSON representing the updated contact.\n- **Response:** NoContent on success, BadRequest if the ID in the route does not match the contact ID.\n\n### 4. Create Contact\n\n- **Endpoint:** `POST /api/Contacts`\n- **Description:** Create a new contact.\n- **Request Body:** JSON representing the new contact.\n- **Response:** CreatedAtAction with the new contact details.\n\n### 5. Delete Contact\n\n- **Endpoint:** `DELETE /api/Contacts/{id}`\n- **Description:** Delete a contact by ID.\n- **Response:** NoContent on success, NotFound if the contact is not found.\n\n## How to Run\n\n1. Clone this repository.\n2. Set up a SQL Server or another compatible database and update the connection string in `appsettings.json`.\n3. Run the application using Visual Studio or `dotnet run`.\n4. Test the API using a tool like [Postman](https://www.postman.com/) or [Swagger](https://swagger.io/).\n\n## Docker Support\n\nThis project includes a Dockerfile to facilitate containerized deployment.\n\n### Build Docker Image\n\nTo build the Docker image, run the following command in the project directory:\n\n```bash\ndocker build -t contacts-app .\nOnce the Docker image is built, you can run a container using the following command:\ndocker run -p 8080:80 -d contacts-app\n\n## Dependencies\n\n- ASP.NET Core\n- Entity Framework Core\n- Microsoft.Extensions.DependencyInjection\n- Microsoft.EntityFrameworkCore.SqlServer\n\nFeel free to customize and extend this project based on your specific requirements. For any issues or improvements, please create an issue or submit a pull request.\n\nHappy coding!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahulmule%2Fcontactsapp_dotnetrestapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frahulmule%2Fcontactsapp_dotnetrestapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahulmule%2Fcontactsapp_dotnetrestapi/lists"}