AWS Security Model

Create .Net 5 Web API (.Net Core)

 Create Web API using .Net 5

Agenda:-

  • What is Web API
  • How to create Web API
  • Implement swagger    

Prerequisite:-

    Basic knowledge of C#, HTML, Visual Studio, and Object Oriented Programming is required.

What is Web API:-

    .Net 5 Web API is framework for building web API's.
    
     i.e. Http based services on top of dotnet 5 



How to create REST API:-

    Step 1:-
        Open Visual Studio 2019 and above and click on create new project.        
        

    Step 2:-
        Search Web API and select ASP.NEt Core Web API template and then click Next button.

    Step 3:-        
  • Enter Project Name
  • Location
  • Check Or Uncheck Checkbox 
    • Check - Create Solution file.
    • Uncheck- Not Creating any solution file.
  • And Click Next Button


    Step 4:-
  • Select Target framework based on your requirement 2,3 and 5.
  • Select Authentication Type if required for me not required
  • Check Configured Https checkbox.
  • Check Docker Checkbox if required for me It's not required.
  • And Click on Create Button to Create a project.

    Step 5:-
            our project look like this 

    Step 6:-
        By default, created WeatherForecast Controller.
    Step 7:-
        Click on Start button to Run this Application 
        


    Step 8:-
        if you created API project swagger by default implemented and It's look like this 

Implement Swagger:-

    For Swagger implementation 
  •    Select your project in Solution Explorer 
  •    Open NuGet package manager
  •    Search Swagger and install below packages


After this goto Startup.cs

&&




Thanks For your time 

If you like our blog, please click on follow button.



Comments