Coder Social home page Coder Social logo

productapi's Introduction

ProductAPI

CRUD WebAPI App with .NET 6 and Swagger API documentation.

Description

  • This Web API app is demonstration of CRUD operations with Swagger API documentation for testing APIs.
  • Technology used - C#, .NET 6 and Swashbuckle nuget package.

How to Install and Run the Project on your environment?

  1. Clone the project on local directory.

image

  1. Go to Solution view from Solution Explorer

image

  1. Go to appsettings.json file and copy the ConnectionStrings object
   "ConnectionStrings": {
     "SqlServerConnection": "server=\\LocalDBServer;database=productsdb;TrustServerCertificate=True;Integrated Security=SSPI"
   } 
  1. Go to ProductAPI Project and right click on it and select Manage User Secrets

image

  1. paste the ConnectionStrings object in Secrets json file.
   "ConnectionStrings": {
     "SqlServerConnection": "server=\\LocalDBServer;database=productsdb;TrustServerCertificate=True;Integrated Security=SSPI"
   }  
  1. Create database with name 'productsdb' in your SQL Server instance and add Server name and database name in secrets.json

image

  1. Now Open Package Manager Console

image

  1. Then you need to install Entity Framework Core CLI, so perform below command in Package Manager Console.
dotnet tool install --global dotnet-ef
  1. Then you need to update changes for database tables to your SQL Server instance, so perform below command in Package Manager Console.
dotnet ef database update --project ProductAPI
  1. With successfull configuration, now simply select launch type for running project an run the project with F5 key.

image

  1. Now project will be running in browser with swagger API documentation page.

image

productapi's People

Contributors

swapnilcodez avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.