How to Update and Delete with Entity Framework Core
HTML-код
- Опубликовано: 13 фев 2023
- 💻Get the source code: go.dotnetacademy.io/howtoefup...
Entity Framework Core 7 introduced a couple of new powerful APIs that finally allow you to perform database updates and deletes in a very efficient way.
In this video I'll give you all the details.
🔥Become a Senior C# Backend Engineer: juliocasal.com/courses
🗺️Get My Free .NET Backend Developer Roadmap: juliocasal.com/roadmap
Join me on Patreon: / juliocasal
Follow me on LinkedIn: / juliocasal
Follow me on X: x.com/julioc
#entityframework #entityframework #dotnet #aspnetcore #aspnet #dotnetcore
Thank you so much. I learnt something new today and I'm immediately using it in a new project Im coding now.
Awesome!
Nice video Julio! Thanks for this content! 💻
My pleasure!
it is much efficient now, thanks for the video.
You're welcome!
That's so verbose for Update. Even in our high-traffic applications I don't see us using that at all unless all those SetProperty extensions can be replaced with a single changed entity. Especially when all we're doing is using Automapper to map the changes, attaching the changed object to EF, setting the state to modified and saving that. We don't touch individual properties at all.
Fair enough!
Excellent
Thank you! Cheers!
Excellent video ): , can you pls show us how to upsert related items in child tables using this new way ( one to many relationship entities )
Don't have an answer for that one yet, but I'll investigate.
@@juliocasal Thanks for the response, please keep me posted.😃
Now that the context is out of sync... how do you correct that?
Out of sync?
dbContext.Entry(existingGame)
.CurrentValues
.SetValues(updatedGame.ToEntity(id));