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

Sdílet
Vložit
  • čas přidán 8. 01. 2024
  • ASP.NET Core Web API .NET 8 2024 - 9. Async/Await
    Github repository for the project: github.com/teddysmithdev/FinS...
    Twitter: / teddysmithdev
    Github: github.com/teddysmithdev
    Linkedin: / teddy-smith-015ba61a3
  • Jak na to + styl

Komentáře • 33

  • @tarekabiramia913
    @tarekabiramia913 Před 6 měsíci +40

    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  Před 5 měsíci +4

      sweet thanks for commenting!

    • @chiennguyen-in9iz
      @chiennguyen-in9iz Před 3 měsíci +1

      and it also happened to the Update() method too, Is It because of the same reason? Thanks.

  • @ronjohnson123
    @ronjohnson123 Před 6 měsíci +6

    all it took was one teddy video and i instantly understood async & how to implement it, awesome video.

  • @elberghaswe2761
    @elberghaswe2761 Před 6 měsíci +6

    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!!!

  • @maheshtamang6158
    @maheshtamang6158 Před 5 měsíci

    this video was so concise and easy to understand! once again thankyou Teddy for this gem series!

  • @RajVadla
    @RajVadla Před 3 měsíci

    Your .NET Series videos are Practical! Thanks man!

  • @caseyspaulding
    @caseyspaulding Před 6 měsíci

    Yes. async await. Good one. Thanks Teddy

  • @DarlingtonAzramShoniwa
    @DarlingtonAzramShoniwa Před 2 měsíci

    Thank you Teddy

  • @jasminemerchant3167
    @jasminemerchant3167 Před 4 měsíci

    short and crisp :)

  • @roshanthapa25
    @roshanthapa25 Před měsícem

    Async/Await looks piece of cake after watching this series.

  • @lukasbarbagallo4767
    @lukasbarbagallo4767 Před 3 měsíci

    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

  • @kvelez
    @kvelez Před 2 měsíci

    Perfect.

  • @yahyo_bey
    @yahyo_bey Před 4 měsíci +2

    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

  • @serfirazabd
    @serfirazabd Před měsícem +2

    at 5:47 why we did not change the return. should not it be "return Ok(stockDTO);" instead of "return Ok(stocks);" ?

    • @TeddySmithDev
      @TeddySmithDev  Před měsícem

      Yes, i actually missed this part and correct in later video. Amazing you noticed that lol.

  • @AndrewBerry-uo3hy
    @AndrewBerry-uo3hy Před 2 dny

    you are a goat brother

  • @PlayCode_WithMe
    @PlayCode_WithMe Před 27 dny

    I wish that you were working on visual studio(purple one)

  • @maxiphobos
    @maxiphobos Před 6 měsíci

    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  Před 6 měsíci +1

      Yeah plus can’t really come back from a delete too lol

  • @mbawuikestanley6930
    @mbawuikestanley6930 Před 6 měsíci

    When you implemented async, why does the GetAllStock endpoint still returning everything including comments

    • @TeddySmithDev
      @TeddySmithDev  Před 6 měsíci +5

      I noticed this yesterday. I passed in stock instead of stockDto to Ok() (Line 28 + 30) StockController.

  • @madoha8641
    @madoha8641 Před 6 měsíci

    Teddy, why are you re-uploading your videos or updating them?

    • @TeddySmithDev
      @TeddySmithDev  Před 6 měsíci +1

      dunno, just bored and want to re-do my old video + make them better

    • @madoha8641
      @madoha8641 Před 6 měsíci

      is it worth waiting and watching the updated videos or does it not matter if I continue with the old ones@@TeddySmithDev

    • @TeddySmithDev
      @TeddySmithDev  Před 6 měsíci

      Old videos are fine and still relevant. People are still completing them now and getting hired 👍

  • @kitesalet
    @kitesalet Před 6 měsíci

    i got banned from your discord server and i dont know why, it was months ago

    • @TeddySmithDev
      @TeddySmithDev  Před 6 měsíci +1

      I shut discord down. Took way too much time to manage.

  • @alucard4974
    @alucard4974 Před 5 měsíci +1

    C# didn't invent async.
    "C# takes inspiration on async worflows in F#"