EF Core 9 🚀 Database First / DB First (Entity Framework Core 9 / .NET 9) & Code-First Migration

  Рет қаралды 7,292

Patrick God

Patrick God

Күн бұрын

Пікірлер
@uk-yy4qb
@uk-yy4qb 3 күн бұрын
Very good straight forward explanation. Additionally I sometimes use a seperate scaffold folder.
@ionutvlad
@ionutvlad 12 күн бұрын
Very, very nice! I liked the little "hack" at the end with the code-first migration after db-first migration, in order to add the column to the existing table! Nice trick!
@jazzerbyte
@jazzerbyte 13 күн бұрын
Nice overview - including the summary of how to transition from DB First to Code First!
@PatrickGod
@PatrickGod 13 күн бұрын
Glad you enjoyed it!
@mejdikarmani7249
@mejdikarmani7249 13 күн бұрын
Great job, Patrick! Your video arrives at the perfect time. 👏
@YuvarajUV001
@YuvarajUV001 12 күн бұрын
Awesome man ❤‍🔥
@FearGod123
@FearGod123 13 күн бұрын
Thank You Patrick. Happy New Year!
@tulnaf
@tulnaf 12 күн бұрын
Thank you Patrick! i'm learning a lot from you! All with a very pleasant guidance and explanation. 10x!!!!
@junaidkhanvibes-jkv7214
@junaidkhanvibes-jkv7214 12 күн бұрын
it's just amazing ❤❤
@TheYassha
@TheYassha 13 күн бұрын
Amazing, thank you!
@arslaninaustria
@arslaninaustria 13 күн бұрын
Thank God i subscribed, was looking for exact video
@PatrickGod
@PatrickGod 13 күн бұрын
Thanks for the sub!
@billgauvey5321
@billgauvey5321 13 күн бұрын
Nice overview Patrick, everyone seems to demonstrate small databases with a few tables. I would love to see a a video using a large database. I have a lot of tables and a whole lot of stored procedures
@10Totti
@10Totti 13 күн бұрын
Great tutorial thanks!
@PatrickGod
@PatrickGod 13 күн бұрын
Glad you enjoyed it!
@IraquiRizwanVlogs
@IraquiRizwanVlogs 13 күн бұрын
Amazing ❤
@PatrickGod
@PatrickGod 13 күн бұрын
Thanks 😄
@pierbover
@pierbover 12 күн бұрын
Great video! Patrick do you have a video or course on how to setup Identity with a DB first approach?
@partialdata
@partialdata 13 күн бұрын
Thank you for the clarification on this topic! What if my project relies on stored procedures?
@rickhoek6416
@rickhoek6416 9 күн бұрын
Turning SQL Server into a T-SQL DOT APP Server, allowed us to leave the ORM OUT and create CRUD apps instantly with a data driven React Frontend
@icecreamstickmodel
@icecreamstickmodel 11 күн бұрын
"EF Core Power Tools" is still better approach. It is allows to select what tables etc. are imported or updated later. And it contains GUI for Visual Studio.
@luiser2010
@luiser2010 13 күн бұрын
I have used it up to the Net Core 6 version, and it had many performance problems. Has it improved in Net9?
@محمدالشبلاق-ص4ت
@محمدالشبلاق-ص4ت 11 күн бұрын
I think that this is DB First I used it if DataBase is existing and complex schema
@rafazieba9982
@rafazieba9982 13 күн бұрын
This is not called "the DB First" approach. It would be if you could iteratively modify your db and then automatically modify the conceptual model based on that. If you are just creating your first entities from the DB and then using "the Code First" approach from that point on, it is called "scaffolding". It is unfortunately close to impossible to do "the DB First" approach with EF Core.
@gppsoftware
@gppsoftware 13 күн бұрын
You can do 'DB First' with EF Core. You simply run "dotnet ef dbcontext scaffold" after every db change.
@rafazieba9982
@rafazieba9982 12 күн бұрын
@@gppsoftware This will override any change I make to the entities. Any "two db tables into one entity" and other changes will have to be done again and again after every scaffold. With old EF you had an EDMX file with conceptual model and mapping from storage model to conceptual model. Based on that the engine knew what was set up and kept it like this. With scaffolding this is generated from scratch every time.
@gppsoftware
@gppsoftware 12 күн бұрын
@@rafazieba9982 That's why if you look at the EF code, it is partial classes. You shouldn't be changing it. That is why it has been built to be compliant with the 'O' of SOLID. What you should be doing is adding extra files of your own code and deriving from the EF classes or attaching to them with partials. You can then do the scaffold and maintain your own code in separate files that are not touched by the scaffold. Put your classes in a separate folder to the models to those EF creates.
@rafazieba9982
@rafazieba9982 12 күн бұрын
@@gppsoftware It is a good solution but I consider it a "workaround" because it works sometimes but not always. A good example of when you cannot do this is when the numer of tables and the number of entities is different (mapping inheritance). Having said that - never modify autogenerated code. Use partial classes or modify the generation routine.
@gppsoftware
@gppsoftware 12 күн бұрын
@@rafazieba9982 I can't think of a scenario where I have needed to merge two db tables into one entity. To need to do this suggests to me that there is a problem with the data model as a whole. 'Mapping inheritance' suggests to me that you are using something like AutoMapper. The use of this product in itself seems to have created the problem for you: you are saying that EF is no good because Automapper won't do what you want. Well don't use a mapper then! Personally, I don't use mappers (I code the copying) because run-time reflection-based mapping yields poor performance.
@martijnvanderham4317
@martijnvanderham4317 13 күн бұрын
did you have to catch the train? 😅
Getting Started with Entity Framework Core in .NET
26:51
Nick Chapsas
Рет қаралды 36 М.
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
Правильный подход к детям
00:18
Beatrise
Рет қаралды 11 МЛН
We fixed an inconsistency in Kotlin (non-local break & continue)
10:31
Kotlin by JetBrains
Рет қаралды 7 М.
6 Reason to Skip Blazor in 2025
10:15
Deploy & Destroy
Рет қаралды 4,2 М.
Why I choose Blazor over React in 2025
13:28
Gavin Lon
Рет қаралды 9 М.
Testing Entity Framework Core Correctly in .NET
8:03
Nick Chapsas
Рет қаралды 33 М.
Is Asp.NET Core Better than Java Spring Boot?
13:26
Gavin Lon
Рет қаралды 10 М.
A Deep Dive into JVM Start-Up
22:03
Java
Рет қаралды 29 М.
The Logging Everyone Should Be Using in .NET
15:34
Nick Chapsas
Рет қаралды 95 М.
Полная дорожная карта C# разработчика на платформе .NET
42:40
Александр Алексеев | Папочка Дотнета
Рет қаралды 4,9 М.
How To Optimize EF Core Query Performance With Compiled Queries
12:14
Milan Jovanović
Рет қаралды 18 М.
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН