Entity Framework Core Tutorial - Everything You Need to Know to Get Started

  Рет қаралды 40,861

Amichai Mantinband

Amichai Mantinband

Жыл бұрын

Hi everyone! This video covers everything you need to know to get up and running with EF Core today!
We'll talk about the various NuGet packages that we'll add:
Microsoft.EntityFrameworkCore
Microsoft.EntityFrameworkCore.Design
Microsoft.EntityFrameworkCore.Sqlite
As well as the dotnet-ef command line tool which we'll use to create migrations, the database and more.
This video doesn't cover complex relational database relationships. I'll cover this in-depth in the upcoming videos in my main series. If you don't want to miss out on it - make sure to smash the subscribe button!
The GitHub repository we used as the base for the project:
github.com/amantinband/buber-...
The full source code of what we wrote today and all the other videos I released in the past is available for my Patrons (It's 5$). If you want it or you wish to support me on my new KZbin endeavor, the link is over here:
/ amantinband
Connect with me on 'em socials:
github.com/amantinband
/ amantinband
/ amantinband
/ @amantinband
#dotnet #efcore #entityframework #amantinband

Пікірлер: 61
@amantinband
@amantinband Жыл бұрын
Although there are many other great topics (such as relationships) that I didn't cover, I will cover them in-depth with complex examples in the upcoming videos in the number dinners series. In any case, I would love to hear what you think and other topics you would have liked to see in this video!
@DrHeinzDoofenshmirtz
@DrHeinzDoofenshmirtz Жыл бұрын
Hi Amichai. Great video and good starter before you go in-depth! I would specifically really like you to explain relationships, meaning how do I configure a relationship when I want my class to be as DDD-like as possible. And then also how to work with Migrations in a production environment correctly. I understand that you should actually get EF make scripts that are run manuelle or through a pipeline. Another topic I would really like to here about is how User should be thought into the domain. I use Auth0 and can't figure out if User is a domain object, or if it is something else. And then I would also like to know how to set identity up correctly. A totally different topic than EF though 😊
@kylegivler8372
@kylegivler8372 Жыл бұрын
Can't wait for the next video in the Buber Dinner Series. Thanks for sharing! I don't know about others, but I would find your videos to be easier to follow if they were just a bit slower paced (for example Tim Corey goes at the perfect pace to code along while watching his videos), and I would prefer longer videos with less co-pilot auto completions and full visibility of all the code typed (boring or not). I know we can't always get what we want, but I did find enough value in your content to become a Patreon :) Anyways thanks again!
@xbmcme9768
@xbmcme9768 Жыл бұрын
I love your videos and have a small request. Can you show a few more lines of code, like 20-25? You are quite the expert and move very fast, I find myself having to stop and forward/rewind videos frequently because the lines of codes you are typing in don't stay on screen long enough. Looking forward to more of your videos!
@invictuz4803
@invictuz4803 Жыл бұрын
I love your tutorials because you've got real world experience and it shows in the way you introduce your application with some consideration of architecture. There are too many cookie cutter tutorials out there that don't offer nearly as much value as yours. Keep the in-depth videos coming! One thing I want to know is how you came up with this app idea of private breakfast events. I've never heard of such a thing lol!
@forzafaruandrei
@forzafaruandrei Жыл бұрын
The moment I see Amichai posted a new video, I know for sure that I'll learn something useful and interesting
@amantinband
@amantinband Жыл бұрын
Haha thanks!! 🫶🏼
@manaralkammessy6360
@manaralkammessy6360 Жыл бұрын
I cant wait for Domain Layer and EF interaction video!!
@amantinband
@amantinband Жыл бұрын
Same 💪🏼
@diegovivanco5378
@diegovivanco5378 Жыл бұрын
Me too
@Pachwara
@Pachwara Жыл бұрын
Thank you, Amichai. I can't wait for the video where you link DDD and EF Core together. Keep it up
@matthewclements9587
@matthewclements9587 Жыл бұрын
Really good video. Using additional diagrams to show how the concepts worked really helped as it gives a different perspective to just seeing the code
@jamesevans6438
@jamesevans6438 Жыл бұрын
Hey Amichai, absolutely awesome video, thank's so much for the many days it must have taken to put all this together, really liked the flow of design through to implementation, this is better than any dedicated entity framework course I have seen too! - learnt a tun of stuff on this one - I'll be watching this a number of times I think to understand everything. I think this will be really useful to lots of people trying to link DDD to the database via entity framework.
@amantinband
@amantinband Жыл бұрын
Thanks, James, really appreciate it 🙏🏼
@anamuslimun
@anamuslimun Жыл бұрын
Perfect playback speed, you know us man :D Your content is cool! That's the beauty of learning from experienced seniors. I hope you keep posting regularly.
@alexalexander3252
@alexalexander3252 Жыл бұрын
From this video I learned very important skill- to shift rows up and down with a cursor in fast neurotical way. ;-)
@diegovivanco5378
@diegovivanco5378 Жыл бұрын
Thansk Amichai! Good video for beginners in the world efcore
@xbmcme9768
@xbmcme9768 Жыл бұрын
Great intro to EF!
@juliusv2073
@juliusv2073 Жыл бұрын
really clean workflow
@sauravbhatta5303
@sauravbhatta5303 Жыл бұрын
I also recommend you to go over in details regarding one to many and many to many relationship in EF core using the diagram.
@amantinband
@amantinband Жыл бұрын
Do you mean presenting the relationships via a model diagram in Visual Studio?
@sauravbhatta5303
@sauravbhatta5303 Жыл бұрын
@@amantinband absolutely
@jdavid82
@jdavid82 Жыл бұрын
Just have a performance feedback, but first thank you for such an awesome video, I've subscribed. Okay so when you insert lots or rows with Guids defined in C# as Ids, because those values are random, Microsoft Sql Server will have to work hard to place them in the right index location as it inserts each row into the table, if you run a test where you are inserting thousands of rows, you may see a noticeable performance degradation. So I would recommend using int or bigint and let sql server generate the key as autoincrement. If you really want to stick to guids then you can configure them to be autoincrement in sql server and let sql server generate it for you, then you will see that the guids will look very similar one from the next, but that's a configuration on the sql server side, not sure how you would do it on EF, but yeah all good, thank you, awesome video
@caiolopes8693
@caiolopes8693 Жыл бұрын
Great Video Amichai! Can you do a video explaining how to use EF Core for an existing Data Base? I mean, using EF Core with a DB first approach. Thank you!
@amantinband
@amantinband Жыл бұрын
It's already in my list 💪🏼
@rdeem1
@rdeem1 Жыл бұрын
absolutely love your videos!! I see you have intellisense in the terminal as well, how is this done, on windows?
@avecesar
@avecesar Жыл бұрын
Thank you!
@matejl92
@matejl92 Жыл бұрын
Is there any particular reason you prefer doing the configuration of entities in a fluent way instead of using data attributes?
@ahmeddabas
@ahmeddabas 8 ай бұрын
thanx bro , can u make a video to explain Backing Fields in EF Core
@csarts990
@csarts990 Жыл бұрын
Can you please tell me what extension do you use to suggest the code pieces ? thx a lot
@skrp3596
@skrp3596 Жыл бұрын
Hey Amichai, I've been following your previous video about implementing the different aggregates in ddd. How would I approach the saving and loading of the different id types through ef core?
@amantinband
@amantinband Жыл бұрын
Let me know of you still need help with this after today’s video 🙂
@DENDYTWOO
@DENDYTWOO Жыл бұрын
Thank you for your video, Amichai! Can you tell me what a program that let you do arrows and rectangles on your screen?
@DENDYTWOO
@DENDYTWOO Жыл бұрын
And one more question is why are you using .Find() not FirstOrDefault() or SingleOrDefault()?
@amantinband
@amantinband Жыл бұрын
@@DENDYTWOO Thanks! I use Presentify on MacOS, and ZoomIt on Windows
@amantinband
@amantinband Жыл бұрын
Regarding Find vs FirstOrDefault, Find will avoid calling the DB if it can. Here are some more details: stackoverflow.com/a/58779047/10091553
@felixnotthecat4249
@felixnotthecat4249 Жыл бұрын
What software did you use to draw the diagrams?
@the-nasim
@the-nasim Жыл бұрын
Great video. I have a question is it a bad idea for having multiple DbContext for a single database. One for ReadOnly, one for WriteOnly.
@andreistelian9058
@andreistelian9058 Жыл бұрын
If you use it only like that, I don't find a problem with that. But I think it's an overkill if you don't have a very big enterprise application. If you do have that kind of app, maybe it would be better to use replica counts. Replica counts are a way to have multiple databases of the same data. This saves you a lot of time, if you have let's say a lot of writes, since the DBs put a lock both on read and on write when a write is made to the Database. So, by using replica count, you can have only one database to only make writes, and another 2 or 3 replicas of the first db that are used only to make reads. Hope I've made myself understood
@the-nasim
@the-nasim Жыл бұрын
@@andreistelian9058 Thanks for your very helpful answer. I didn't know about replica count. I find this very interesting. I will take a look. Again many thanks.
@waliqadri
@waliqadri Жыл бұрын
Where does this course start from? what is bubber breakfast app?
@borisgomiunik7960
@borisgomiunik7960 Жыл бұрын
Thank you for many explanations, Amichai, many concepts are clear now. What I do still find confusing is why ChangeTracker marks entity as unmodified if its collectoin changes (navigation property). Is this intentional?
@amantinband
@amantinband Жыл бұрын
Thanks, Boris. The change tracker is for EF Core to know what tables to update. It helps to think of the underlying tables and what data needs to be deleted/modified/added
@borisgomiunik7960
@borisgomiunik7960 Жыл бұрын
@@amantinband It actually makes sense, thank you for your reply. Any tips on where to look for the original values for collections (kind of like in properties in change tracker)?
@brunoweb4
@brunoweb4 Жыл бұрын
Can you give us a little spoiler about using EF on the DDD Project? (I am guessing that you are gointg to create some kind of model classes to satisfy EF on the infra layer + using mapster to map them to domain classes)
@amantinband
@amantinband Жыл бұрын
Sure 😁 The configuration files are the mapping between the domain models and the actual database. I don't think another anti-corruption-style set of models is needed.
@juke-duke
@juke-duke Жыл бұрын
How do you have the option to sync namespace with the folder you are in when moving it around?
@amantinband
@amantinband Жыл бұрын
I have a vscode extension called "C# Namespace Autocompletion" that I use for defining namespaces (I usually use the namespace-fill option)
@juke-duke
@juke-duke Жыл бұрын
@@amantinband I use the extension aswell, but Im talkong about you had this option say like to sync the namespace with the folder structure. You moved a file to another folder and were able to match the namespace and change it everywhere, I have to manually go and change all my namespace references when I move the file around. How did you do this, and thank you.
@juke-duke
@juke-duke Жыл бұрын
@@amantinband Any information on this would be greatly appreciated, it definitely helps refactoring on vscode so much
@tibba69
@tibba69 9 ай бұрын
I really wish we could use EF Core but as far as I know, it does not support the database my company is stuck using - IBM for i or DB2 iSeries (or whatever it’s called these days). To make it worse we are stuck on version v5r4! 😢 Does anybody know if EF Core can be used for this as I haven’t been able to find anything for years.
@shuvbhowmickbestin
@shuvbhowmickbestin 4 ай бұрын
Don't get why the properties must be made private regardless of the fact that EFCore iterates over the properties and adds them to the migration definition. I mean why must they be private? And why must we have an empty constructor for Breakfast for EfCore to work? Timestamp: 17:56
@narekhovhannisyan6362
@narekhovhannisyan6362 Жыл бұрын
Amichai are you Armenian? 😊
@amantinband
@amantinband Жыл бұрын
Nope, I'm Israeli 😎 what made you think?
@narekhovhannisyan6362
@narekhovhannisyan6362 Жыл бұрын
@@amantinband 14:22
@amantinband
@amantinband Жыл бұрын
@@narekhovhannisyan6362 haha no it stands for Amichai Mantinband
@mauriziostrazzullo1419
@mauriziostrazzullo1419 7 ай бұрын
What is the point of studying if you are going to replace us all?
@rabenstein9234
@rabenstein9234 2 ай бұрын
What happened to your voice?
@xxapoloxx
@xxapoloxx Жыл бұрын
This is borderline unintelligible
Make the .NET CLI Your Best Friend | .NET & C# Essentials
19:41
Amichai Mantinband
Рет қаралды 13 М.
Эффект Карбонаро и бесконечное пиво
01:00
История одного вокалиста
Рет қаралды 6 МЛН
What Are Your Thoughts on Entity Framework Core vs. Dapper?
21:49
Making Entity Framework Core As Fast As Dapper
13:17
Nick Chapsas
Рет қаралды 82 М.
Entity Framework Migrations Explained
36:53
dotnet
Рет қаралды 28 М.
Clean Architecture vs Domain-Driven Design (DDD) - Understand the Difference
11:26
Get started with ENTITY FRAMEWORK in C#!
15:57
tutorialsEU - C#
Рет қаралды 12 М.
Apple Just Integrated ChatGPT and Elon Musk is Furious!
8:08
AI Revolution
Рет қаралды 23 М.
cool watercooled mobile phone radiator #tech #cooler #ytfeed
0:14
Stark Edition
Рет қаралды 9 МЛН
МОЩНЕЕ ТВОЕГО ПК - iPad Pro M4 (feat. Brickspacer)
28:01
ЗЕ МАККЕРС
Рет қаралды 69 М.
iPhone 12 socket cleaning #fixit
0:30
Tamar DB (mt)
Рет қаралды 32 МЛН
WWDC 2024 Recap: Is Apple Intelligence Legit?
18:23
Marques Brownlee
Рет қаралды 5 МЛН