Section 1: Creation of an ASP .Net Web API Tutorial - Introduction

 

Introduction

I am creating a series of lessons to learn to create a basic ASP .Net Web API. We shall create a full end-to-end project and please follow the Sections in sequence for better understanding.

I have created this course to make it the easiest way to understand.

From this tutorial, you will learn -

a. Web API in .Net Core 3.1.

b. Creation of Controllers.

c. What are Models?

c. Adding Database using Entity Framework (Code-First approach).

d. Learn how to use the Repository, Unit of Work pattern in .Net Core.

d. Using Automapper in ASP.NET Core.

e. Data Transfer Objects (DTOs).

f. API Documentation using Swagger.

g. Authentication and Authorization of APIs.


What are we trying to build in this course?

We will create a 'Hotel Management' website. The user can view the list/query of Hotels available. Also, the user can create, update, and delete the Hotels (These operations are called "CRUD" operations). The Hotel information is stored in the Database, and we shall use an SQL server to store the data. Everyone cannot createupdate, and delete the hotels. Only Admins can do it. Hence, we will also have a registering the users, login, and logout functionalities too.


This is how the website looks


This is the Create window.



This is the Delete window




Tools you need:

a. Visual Studio 2019.

b. Postman.

cSQL Server Management Studio (SSMS)


Source Code location:

bharath9788/LearningMVCZeroToMastery (github.com)

Please check out this code and keep it handy.


Basic Architecture:

I have created two projects: LearningMVC and ViewsForAPI. LearningMVC has the core logic of all business logic. ViewsForAPI is just for the Views. It uses MVC architecture. You can anytime change the View/UI by using the same core protect, LearningMVC.


Ideally, for the production code, the UI should be in HTML, CSS, Angular JS. This course emphasizes on learning ASP .Net.


Let's begin to learn!


Section 1. Creating a Web API project in Visual Studio 2019


a. Open Visual Studio 2019 and click Create a new Project.




b. Provide a name for the project and you will get the below next screen



c. Select API. This will create a project.



d. The project has been created.




Outroduction:

You just got an overview of the course here. In the next section, you will see how to create a Table in the Database using the ASP .Net's Entity Framework concept.

Happy learning!