Lesson 2 - E-shop in ASP.NET Core MVC - Identity, database, and layout

C# .NET ASP.NET ASP.NET Core E-shop E-shop in ASP.NET Core MVC - Identity, database, and layout

In the previous lesson, E-shop in ASP.NET Core MVC - Solution Structure, we explained that larger applications need to be divided into multiple layers, and also prepared the structure of our solution. In today's ASP.NET Core tutorial, we're going to install the necessary packages for our project and put the user and database logic into the data layer. We'll continue by generating a database, including the basic settings. We'll also work on a visually appealing layout for the application.

NuGet package manager

Before we move to the data layer, let's install the necessary packages into this project to avoid errors and make editing the code easier. We'll use the NuGet Package Manager to install the following packages into our project. To do this, we'll use the application menu and choose Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution. Here, we'll choose the Browse tab and download and install the necessary packages:

  • Microsoft.EntityFrameworkCore
  • Microsoft.EntityFrameworkCore.SqlServer
  • Microsoft.EntityFrameworkCore.Proxies
  • Microsoft.AspNetCore.Mvc
  • Microsoft.AspNetCore.Identity
  • Microsoft.AspNetCore.Identity.EntityFrameworkCore
  • Microsoft.Extensions.Configuration.Json

(We'll use some of these packages later).

Another way is to use the Package Manager Console. We could install the packages by the following command:

Install-Package package_name

Moving the prepared classes into the data layer

Let's first move (create) a part of the Identity functionality into the data layer. Since we'll want to extend our users in the future,


 

...End of the preview...

Commercial article (licence no-reselling)

Commercial article (licence no-reselling)

This article is based on many years of experience in the IT field, and describes how to develop a professional commercial product or parts, that can be directly used to generate profit or to get as a gate into the industry.

This knowledge is only can only be used properly by the members of our community who are working their way up to become IT professionals. Therefore, this knowledge is only available in exchange for points. You can use the source code from this article for one commercial project. However, you will not be able to resell it. Simply put, you can't buy our article once and then sell our code multiple times. If you need to use this code a bit more extensively, we are ready to discuss Commercial licence options with you. You can find more info on this in the following article Licence.

Are you ready to become a professional? All you have to do is click here!.

Article description

Requested article covers this content:

In this ASP.NET Core tutorial, we'll set the connection string, manage migrations, make adjustments before generating the database and set up the design.

Limited offer: Learn all knowledge and save money

Buy articles and tests separately one by one 420 points
Buy the course including all articles and features for an exclusive price 357 points
Currently, you have 0 points
By buying this exclusive package, you'll have access to all 15 articles in this course including exercise submitting while saving $5.67. This offer is limited for the first articles only with an additional exclusive 15% discount.
You gain 357 points for adding an article to the site, or for $37.80 $32.13

Buy just this article

Warning, by buying just this article you'll lose the limited 15% discount for the package of all the articles.

To access the article, you need 30 points
Currently, you have 0 points
You gain 30 points for adding an article to the site, or for $2.70

Buying this article gives you unlimited access to it forever. You will learn some more and help us keep giving our site maintenance which helps you and others get better futures. It's a win-win.

This article is licensed :Premium no-reselling II, by buying this article, you agree with the terms of use.

You gain points by supporting our network. This is done by sending a helpful amount of money to support the site, or by creating content for the network.

You can get points immediately using:

Credit card SMS Wire transfer
Credit card SMS Wire transfer

 

Article has been written for you by Simon Racz
Avatar
Activities (2)