Create UserRoles Table
CREATE TABLE [dbo].[UserRolesMapping](
[Id] [int] IDENTITY(1,1) NOT NULL,
[UserId] [int] NULL,
[RoleId] [int] NULL,
PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[UserRolesMapping] WITH CHECK ADD FOREIGN KEY([RoleId])
REFERENCES [dbo].[Roles] ([Id])
GO
ALTER TABLE [dbo].[UserRolesMapping] WITH CHECK ADD FOREIGN KEY([RoleId])
REFERENCES [dbo].[Roles] ([Id])
GO
ALTER TABLE [dbo].[UserRolesMapping] WITH CHECK ADD FOREIGN KEY([UserId])
REFERENCES [dbo].[Users] ([Id])
GO
Step 2
Make a new project with Visual Studio 2019 or another editor of your choice.
Step 3
Choose the "ASP.NET web application" project and give an appropriate name to your project and then click on "Create".

Figure: Create New ASP.NET Web Application
Step 4
Ā
Then, choose āEmptyā and select MVC from the checkbox and then add the project.

Figure: create the Empty project after a click on the Mvc checkbox
Step 5
Add a database model by right-clicking the Models folder. Now, add the Entity Framework and for that, you have to right-click on the Models folder and then choose "New itemā¦".
Figure: add the new item in the Model folder of the project
You will be presented with a window; from there, pick Data from the left panel and select ADO.NET Entity Data Model, name it EmployeeModel (this name is not required; any name will suffice), and click "Add."

Figure: Select the ADO.NET Entity Data Model and Give the name to that Model
The wizard will open after you click "Add a window." Click "Next" after selecting EF Designer from the database.
Select the EF Designer from the database and then click on the next in the wizard
Ā
A window will display after clicking on "Next".Select "New Connection.". After that, a new window will open. Enter your server's name, followed by a dot if it's a local server (.). Click "OK" after selecting your database.

Figure: Connection Properties with server name and database name
The connection will be established. Save the connection name as you wish. Below is where you can modify the name of your connection. The connection will be saved in the web configuration. Now click on the "Next" button.
Figure: Entity Data Model wizARD with newly connected FormAuthFDb database
A new window will display after you click NEXT. Click "Finish" after selecting the database table name as seen in the screenshot below.
Now, Entity Framework is added, and a class is created for each entity in the Models folder.
Figure: Employee Model
Step 6
Now right-click the Controllers folder and then choose Add Controller.

Figure: Add the New Controller in controller folder
There will be a window appear. Click "Add" after selecting MVC5 Controller-Empty.

Figure: select MVC5 Controller-Empty from the controller
After selecting "Add," a new window with the name DefaultController will appear. Then change the name to the controller HomeController and then click on Add.
Step 7
When you right-click on the Index method in HomeController, the "Add View" dialogue will pop up, with the default index name selected (use a Layout page), and after that select the "Add" button to add a view for the index method.