Entity Framework Code First (2021, DotNet Core or DotNet 5)

preview_player
Показать описание
Entity Framework Code First from scratch - build a new project and create data classes, then generate the database from your models using Entity Framework (Code First). This video also shows you then how to query the database using EF after you have generated the schema, and up to apply migrations to update/scaffold the database. Examples are in SQL server but could be applied to other similar databases like MySQL.
Рекомендации по теме
Комментарии
Автор

As someone coming from Dapper, this saves so much time and works like magic!

DanFlakes
Автор

Great job! I was looking for a great guide on this topic and here it is. 🦍

dizmo..
Автор

thank you very much, it was excellent explanation for my problems.

emrahkzltan
Автор

Good presentation. Everything was clear. Here are my questions. 1. How do you use the data annotation to display error messages in a production environment especially the required attribute. 2. Is dependency injection supported in console or window application when using entity framework core in these environments.

taiwobabalola
Автор

Source code is here at this github link, but I advise watching the video first as it will explain the where/why and how to generate the generated portions..:

DataVids
Автор

Thank you! i have a question, i moved from visual studio 2019 to 2021, but now how do I use the package manager, it seems I need to reset the migration and restart again?

hqcart
Автор

Hello, have you heard about any changes for Code First approach in .NET 6?

Hazuuur
Автор

One more, in the onconfiguring override method, is it possible to pass the name of the connection string from app.config file

taiwobabalola
Автор

It's insane how much extra work you have to do for codefirst development. I'm baffled that anyone thinks this is a good idea.

allenbythesea
Автор

how can we make connections of it with flutter #dart using Sql Server please guide or a video suggestion?

awaishaider
Автор

thankyou very much ! the explanation is so simple that i can easily understand the concept !

leoaldi
Автор

Do you have a database first approach video?

troymitchel
Автор

sir how to create login page for pos system using sqlite and c#

sivasothytharsi
Автор

Hello. I am using Mac with M1 chip. I tried command ' dotnet ef database update ' but I got this error:

LocalDB is not supported on this platform.

Do you know what is the problem?

Thank you so much!

VukotaDjLewu
Автор

This keeps happening where the comments show up in my email but don't make it to the channel. Perhaps your comments are being flagged? Responding to @Mitesh M If you have a local connection from your pc to sql express, then you can setup either sql server authentication or you can setup windows active directory authentication. If you use the default ad connection we can use 'trusted connection', and so your connectionstring may be similiar to this: Trusted_Connection=True;" and don't use the double backslash (just one backslash) if you are referring to the EF console command to generate scaffolding or models, etc. use the double if its in appsettings.json. Hope that helps you and/or someone else and hopefully your comments start showing up!

DataVids
Автор

Hi @16:45 you use for DataAnnotation MaxLength, i use StringLength whats the diffrence

mxply
Автор

Yeah!!! It's been along time, shouldn't have left you, without a Data Vid to step to. 🤣🤣🤣1OVE.

PIMARINE
Автор

where can i check my connection string in ssms

namansharma
Автор

Thanks for your video, but Entity Framework is totally removed from our system, it's just too messy and difficult to maintain for all developers. It could work in a very small system but not the enterprise level! Not sure what Microsoft was thinking when they implemented this!

STUPIDYOUTUBE_HIDINGMSGS
Автор

Wait a minute. Before you scaffolded and performed a database update, the database itself already exist, you only added the tables to it. Right?

angel_machariel