Install entity framework core in visual studio

preview_player
Показать описание
In this video we will discuss how to install Entity Framework Core in Visual Studio.

Text version of the video

Healthy diet is very important for both body and mind. We want to inspire you to cook and eat healthy. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking.

Slides

ASP.NET Core Text Articles & Slides

ASP.NET Core Tutorial

Angular, JavaScript, jQuery, Dot Net & SQL Playlists

Depending on how you have your project set up, you may have Entity Framework Core already installed.

Single Layer Web Application

If it's a small project, you may have your presentation layer, business layer and data access layer all in one project. So if you have created a web application project using ASP.NET Core 2.1 or higher, then in that web application project, you already have Entity Framework Core installed.

Entity Framework Core in ASP.NET Core Web Application Project

An ASP.NET Core Web application project that is created using ASP.NET Core 2.1 or higher has the following NuGet package installed.

Microsoft.AspNetCore.App

This package is called - metapackage. A metapackage has no content of its own but is a list of dependencies (other packages). You can find this metapackage, in the Solution Explorer. When you expand the metapackage, you can find all the dependencies. In the dependencies you will find the Entity Framework Core nuget packages already installed.

Multi Layer Web Application

In a large application we will usually have at least the following 3 layers
Presentation Layer
Business Logic Layer
Data Access Layer

These layers are implemented as separate projects. Entity Framework Core is usually required in the Data Access Layer project. The Data Access Layer project is a class library project and does not usually have the meta package referenced. So this means, Entity Framework Core is not installed for the Data Access Layer project.

To install Entity Framework Core and to be able to use SQL server as the database for your application, you need to install the following nuget packages.

Microsoft.EntityFrameworkCore.SqlServer - This nuget package contains SQL Server specific functionality
Microsoft.EntityFrameworkCore.Relational - This nuget package contains functionality that is common to all relational databases
Microsoft.EntityFrameworkCore - This nuget package contains common entity frameowrk core functionality

Microsoft.EntityFrameworkCore.SqlServer has a dependency on Microsoft.EntityFrameworkCore.Relational package.
Microsoft.EntityFrameworkCore.Relational package has a dependency on Microsoft.EntityFrameworkCore package.
Microsoft.EntityFrameworkCore package has a dependency on several other packages.

When we install Microsoft.EntityFrameworkCore.SqlServer package, it also installs all the other dependant nuget packages automatically.

In a class library project, to install a nuget package

Right click on the "Dependencies" node in "Solution Explorer" and Select "Manage NuGet Packages" from the context menu.

On the screen that pops up, search for the package that you want to install and follow the onscreen instructions.

We want to use SQL Server as the database for our application, so we used the nuget package Microsoft.EntityFrameworkCore.SqlServer. This package is usually called Database provider package.

If you want to use a different database with your application, then you will have to install that database provider specific nuget package instead of Microsoft.EntityFrameworkCore.SqlServer database provider package.

For example, if you want to use mysql as your database, then install Pomelo.EntityFrameworkCore.MySql database provider package. Along the same lines, if you want to use PostgreSQL as your database, use Npgsql.EntityFrameworkCore.PostgreSQL database provider package.

You can find all the provider specific NuGet packages on the following MSDN page
Рекомендации по теме
Комментарии
Автор

Just what I was waiting for. I have trying to figure out what EF is. Now have the answer thanks to this video and the previous one. VERY USEFUL. again many thanks.

salomonks-francais
Автор

my man Venkat explains better than guys on plural sight.
thank you for doing all these things for community.
big up!

challica
Автор

LOVE U MAN :D i WOrk CUZ of your tutorials now :D

darkogele
Автор

Thank you very much, this is a very clean tutorial!

halivudestevez
Автор

Excellent Explanation and great effort
Thank you very much

talkathiriify
Автор

Thanks man for your invaluable efforts & contributions for programming learners.
Could you please take some performance related tutorial entity framework core.

turnaround
Автор

I welcome your efforts and wish you continued success.Many thanks for this information

emirkababyk
Автор

Thank you for the explanation on layered projects!

hernanvelazquez
Автор

Thank you so much Brother Its helped me a lot..🤩🤩

sivakarthikeyans
Автор

Can you please make videos on implementing the layered architecture? Because I had some troubles with it, for example: normally you would return 'NotFound' object, but you cant do those kind of stuff from the business logic layer. Also I would really like if you could make videos about Docker, I would srsly pay you for that : D

deb
Автор

HI can you plz make EF core in separate class library for DAL

scholars
Автор

Please make a video on using callbacks in c#

santoshparihar
Автор

I eagerly wait for sound at the end of videos.

muhammadmoazzamjan
Автор

What needs to installed for Sybase dataprovider

pallaviganesh
Автор

You are like Narendra Modi of IT world. There is no any comparison in the whole IT world for you. Thanks for all the series till now. It's simply awesome..

vivekanand
Автор

What happened with model first approach? :(

Grygier
Автор

5:50 "accept the license agreement" - all your softwarez belong to us

Feel_theagi
Автор

Actually I saw Class Library is a .net Standard instead of .net Core.So we need to choose that class Library

arnoldjohn
Автор

The video is running in 360p only. I can't read the print.

josephregallis