0% found this document useful (0 votes)
2 views32 pages

dot net

The document outlines the steps for setting up an ASP.NET Core project, including configuring the connection string, adding necessary packages, and implementing authentication and authorization features. It details the creation of a database context, migration process, and the addition of user registration and login functionalities. Finally, it emphasizes modifying the layout and navigation based on user authentication status.

Uploaded by

jaideep bhojak
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views32 pages

dot net

The document outlines the steps for setting up an ASP.NET Core project, including configuring the connection string, adding necessary packages, and implementing authentication and authorization features. It details the creation of a database context, migration process, and the addition of user registration and login functionalities. Finally, it emphasizes modifying the layout and navigation based on user authentication status.

Uploaded by

jaideep bhojak
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

ASP.

NET Core Project Details

"ConnectionString":{

"Database_Name": "server=.;database=Database_Name;Integrated Security=true;"

},

In DAL:

[Link]

[Link]

Then add datacontext folder:


In Databasecontext class:
Now Migration Part:

1st Make references of the projects:

In PM console:

add package [Link] in the project


Initiate the migrations:

Insert Dummy authentications or the data in the users table wont be inserted:

Now add the Interface:


Now inherit the userfunction class: with this

Now in BL:
Authentication and Authorization:
These tables are created in the database:

Add an empty razor view for Register in the pages folder:


Add a ViewModel:
In the controller or in the class of [Link] add the method of register:

Add the Dependencies UserManager and SignInManager:


Now we will change the home page based on whether the user is signed in or not:

Modify the Layout nav bar option accordingly:


Now add Login:
Logout:
Done!!

And Add [Authorize on the Privacy page etc.]


Course By Jess Chadwick:

Added Dbcontext for this and a connectionstring:

Added [Link]();

You might also like