ASP.NET Core Web API .NET 8 2024 - 9. Async/Await

  Рет қаралды 25,347

Teddy Smith

Teddy Smith

Күн бұрын

Пікірлер: 42
@tarekabiramia913
@tarekabiramia913 11 ай бұрын
The reason why Delete() does not allow await is: - It does not involve any immediate database interaction when called, merely a state change in memory - does not involve waiting and is a quick in-memory operation, making it asynchronous would not provide any benefits and could even lead to less efficient resource utilization. Thank you for this amazing content, + leaving a question at the end is a good idea it make us dig more into .NET tricks, keep up the good work
@TeddySmithDev
@TeddySmithDev 11 ай бұрын
sweet thanks for commenting!
@chiennguyen-in9iz
@chiennguyen-in9iz 8 ай бұрын
and it also happened to the Update() method too, Is It because of the same reason? Thanks.
@ronjohnson123
@ronjohnson123 11 ай бұрын
all it took was one teddy video and i instantly understood async & how to implement it, awesome video.
@TeddySmithDev
@TeddySmithDev 11 ай бұрын
Thanks for watching 👍
@antoniofuller2331
@antoniofuller2331 2 ай бұрын
Teddy is going DEEP ;-)
@maheshtamang6158
@maheshtamang6158 10 ай бұрын
this video was so concise and easy to understand! once again thankyou Teddy for this gem series!
@tomasmichek5842
@tomasmichek5842 2 ай бұрын
Awsome video! I love this tutorial series! One detail I noticed - I think you forgot to change the return value in the GET function that returns all the stocks, it should be the new variable 'stockDto' I believe. That's why the request returned the comments as well.
@elberghaswe2761
@elberghaswe2761 11 ай бұрын
Remove is not an I/O operation it's just a mark on the DB to delete something you want to delete. then you have SaveChangesAsync wich it's a real I/O operation and this really delete the id from the DB. Even if you use "remove" you can still use your marked data until u use the savechangesasync method. Anyway nice video!!!
@TeddySmithDev
@TeddySmithDev 11 ай бұрын
🙌👏
@serfirazabd
@serfirazabd 6 ай бұрын
at 5:47 why we did not change the return. should not it be "return Ok(stockDTO);" instead of "return Ok(stocks);" ?
@TeddySmithDev
@TeddySmithDev 6 ай бұрын
Yes, i actually missed this part and correct in later video. Amazing you noticed that lol.
@caseyspaulding
@caseyspaulding 11 ай бұрын
Yes. async await. Good one. Thanks Teddy
@RajVadla
@RajVadla 8 ай бұрын
Your .NET Series videos are Practical! Thanks man!
@_jeff.medeiros
@_jeff.medeiros 4 ай бұрын
Dude you're a legend
@TeddySmithDev
@TeddySmithDev 4 ай бұрын
Thanks Jeff!!
@lukasbarbagallo4767
@lukasbarbagallo4767 9 ай бұрын
the async await keywords is neat syntax allowing concurrency. C# did not invent concurrency or the ability to boost performance of software by utilizing concurrency. However C# came up with syntax which made concurrent programming more accessible, a keyword/syntax pattern which has later been adopted by many popular langs eg python and js. awesome vids! learning a lot
@TeddySmithDev
@TeddySmithDev 9 ай бұрын
Nice troll attempt lmao
@lukasbarbagallo4767
@lukasbarbagallo4767 8 ай бұрын
@@TeddySmithDev even better troll attempt
@MihoubAhmed1
@MihoubAhmed1 3 ай бұрын
Remove() method is not a time-consuming operation whereas it only changes a simple state in tracker, while the other counterparts e.g. Find() need to ping the Database which would be a time-consuming process.
@paskostipandzija4568
@paskostipandzija4568 15 күн бұрын
For me aysinc was invented way earlier like in c drivers. Great video
@yahyo_bey
@yahyo_bey 9 ай бұрын
why Remove is not async? Because Remove is quick operation. Removing an object is very simple and fast operation, it doesn't involve waiting any external resources db call, making network calls, and reding from disk
@DarlingtonAzramShoniwa
@DarlingtonAzramShoniwa 8 ай бұрын
Thank you Teddy
@jasminemerchant3167
@jasminemerchant3167 10 ай бұрын
short and crisp :)
@roshanthapa25
@roshanthapa25 6 ай бұрын
Async/Await looks piece of cake after watching this series.
@andreashadjithoma7278
@andreashadjithoma7278 4 ай бұрын
Thank you for the great content! I assume that we can use *Add* instead of *AddAsync* because according to Microsoft: _"This method is async only to allow special value generators, such as the one used by 'Microsoft.EntityFrameworkCore.Metadata.SqlServerValueGenerationStrategy.SequenceHiLo', to access the database asynchronously. For all other cases the non async method should be used."_ As far as I noticed we are not using sequences right?
@kvelez
@kvelez 8 ай бұрын
Perfect.
@PlayCode_WithMe
@PlayCode_WithMe 6 ай бұрын
I wish that you were working on visual studio(purple one)
@mbawuikestanley6930
@mbawuikestanley6930 11 ай бұрын
When you implemented async, why does the GetAllStock endpoint still returning everything including comments
@TeddySmithDev
@TeddySmithDev 11 ай бұрын
I noticed this yesterday. I passed in stock instead of stockDto to Ok() (Line 28 + 30) StockController.
@madoha8641
@madoha8641 11 ай бұрын
Teddy, why are you re-uploading your videos or updating them?
@TeddySmithDev
@TeddySmithDev 11 ай бұрын
dunno, just bored and want to re-do my old video + make them better
@madoha8641
@madoha8641 11 ай бұрын
is it worth waiting and watching the updated videos or does it not matter if I continue with the old ones@@TeddySmithDev
@TeddySmithDev
@TeddySmithDev 11 ай бұрын
Old videos are fine and still relevant. People are still completing them now and getting hired 👍
@antoniofuller2331
@antoniofuller2331 2 ай бұрын
​@@TeddySmithDev is this an old video???
@maxiphobos
@maxiphobos 11 ай бұрын
Maybe EF repository Delete isn't async to avoid (prevent) other async code manipulating with deleting entity in the same method. It's hard to predict when the async function will finalize its work, so it might be the situation when another function manipulates an entity which hasn't yet been deleted because of the async method work but will be deleted soon.
@TeddySmithDev
@TeddySmithDev 11 ай бұрын
Yeah plus can’t really come back from a delete too lol
@AndrewBerry-uo3hy
@AndrewBerry-uo3hy 5 ай бұрын
you are a goat brother
@kitesalet
@kitesalet 11 ай бұрын
i got banned from your discord server and i dont know why, it was months ago
@TeddySmithDev
@TeddySmithDev 11 ай бұрын
I shut discord down. Took way too much time to manage.
@alucard4974
@alucard4974 10 ай бұрын
C# didn't invent async. "C# takes inspiration on async worflows in F#"
@antoniofuller2331
@antoniofuller2331 2 ай бұрын
Stop hating dummy, C# invented it. F# only had the workflows
ASP.NET Core Web API .NET 8 2024 - 10. Repository Pattern + DI
10:23
That's NOT How Async And Await Works in .NET!
12:25
Codewrinkles
Рет қаралды 28 М.
#behindthescenes @CrissaJackson
0:11
Happy Kelli
Рет қаралды 27 МЛН
Await Async Tasks Are Getting Awesome in .NET 9!
9:24
Nick Chapsas
Рет қаралды 103 М.
The Logging Everyone Should Be Using in .NET
15:34
Nick Chapsas
Рет қаралды 91 М.
Brutally honest advice for new .NET Web Developers
7:19
Ed Andersen
Рет қаралды 293 М.
"Stop Using Async Await in .NET to Save Threads" | Code Cop #018
14:05
ASP.NET Core Web API Identity JWT 2024 - 21. Install Identity
15:38
Real 10x Programmers Are SLOW To Write Code
14:51
Thriving Technologist
Рет қаралды 69 М.
Why aren't you using Fastify? Or Koa? Or NestJS?
9:58
Maximilian Schwarzmüller
Рет қаралды 71 М.
Forget Controllers and Minimal APIs in .NET!
14:07
Nick Chapsas
Рет қаралды 79 М.
When You Shouldn't Use Await Async in .NET
7:51
Nick Chapsas
Рет қаралды 52 М.
How FastAPI Handles Requests Behind the Scenes
5:09
Code Collider
Рет қаралды 38 М.