Skip to content

This project showcases the latest ASP.Net Core Web API v2 with CORS functionality to provide RESTFul API Endpoints for use by Desktop / Web applications and Mobile Apps with SSL and has basic functionality to dowload data as an Excel file

License

Notifications You must be signed in to change notification settings

SaleemCB/ASP_DotNetCore_WebAPI

Repository files navigation

ASP.NET Core Web API

Welcome to the ASP.NET Core Web API repository by ConceptZee Solutions. This project demonstrates how to build a robust and efficient Web API using ASP.NET Core.

Table of Contents

Introduction

This project showcases an ASP.NET Core Web API designed to handle various HTTP requests and perform CRUD operations. It is a simple yet comprehensive example to get you started with building APIs in ASP.NET Core.

Features

  • CRUD Operations: Perform Create, Read, Update, Delete operations on entities.
  • Entity Framework Core: Database management using EF Core.
  • Dependency Injection: Implement DI for better code maintainability.
  • Automated Testing: Basic unit tests for API endpoints.
  • Error Handling: Robust error handling and validation.

Technologies Used

  • ASP.NET Core: The framework used for building the Web API.
  • Entity Framework Core: For database interactions.
  • Swagger: For API documentation and testing.
  • xUnit: For unit testing.

Setup and Installation

Prerequisites

Installation Steps

  1. Clone the repository:

    git clone https://github.com/SaleemCB/ASP_DotNetCore_WebAPI.git
    cd ASP_DotNetCore_WebAPI
  2. Restore packages:

    dotnet restore
  3. Update Database: At present this uses an SQLite Db Update your database connection string in appsettings.json and run the following command to apply migrations:

    dotnet ef database update
  4. Run the application:

    dotnet run

Usage

Running the Project

  • Launch the project in Visual Studio 2022.
  • Build the solution and run the project.
  • Use Swagger UI to test the API endpoints at http://localhost:5000/swagger.

Swagger UI

The API documentation is available via Swagger at http://localhost:5000/swagger. Use this interface to interact with the API endpoints and test their functionality.

Endpoints

Here is a list of the main API endpoints:

  • ** GET /api/czeecontacts/GetContacts: Retrieve a list of contacts.
  • ** GET /api/czeecontacts/GetContacts/{id}**: Retrieve a specific contact by ID.
  • ** POST /api/czeecontacts/PostContact: Create a new contact.
  • ** PUT -- not yet implemented.
  • ** DELETE /api/export/ClearContacts: Deletes all contacts.

Contributing

Contributions are welcome! Please submit a pull request or open an issue to discuss changes.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

This project showcases the latest ASP.Net Core Web API v2 with CORS functionality to provide RESTFul API Endpoints for use by Desktop / Web applications and Mobile Apps with SSL and has basic functionality to dowload data as an Excel file

Topics

Resources

License

Stars

Watchers

Forks

Languages