AsyncLocal and Scoped Services in ASP.NET Core

Поделиться
HTML-код
  • Опубликовано: 27 ноя 2024
  • Learn about AsyncLocal class in c# and how you can use it as a scoped service in an asp.net core app.
    Support my Work 🤝 / raw_coding
    Buy my Courses 📚 learning.raw-c...
    Buy my Merch 🛒 shop.raw-codin...
    Join the Community 💬 / discord
    Tweet Tweet 📣 / anton_t0shik
    Tune in LIVE! 🎥 / raw_coding
    #csharp #async

Комментарии • 13

  • @ivandrofly
    @ivandrofly 6 месяцев назад +13

    “Zeus! Your Son Has Returned. I Bring The Destruction Of Olympus!”

  • @cocoscacao6102
    @cocoscacao6102 6 месяцев назад +1

    Great video again. Never heard of AsyncLocal up until now.

  • @binoypatel09
    @binoypatel09 6 месяцев назад

    Nicely explained, thanks for the great content

  • @diegoronkkomaki6858
    @diegoronkkomaki6858 6 месяцев назад +1

    Good stuff, learned a lot.

  • @jamesarceri5540
    @jamesarceri5540 6 месяцев назад

    Good stuff as always sir.

  • @piotrc966
    @piotrc966 6 месяцев назад

    Really great!

  • @urzaaaaa
    @urzaaaaa 6 месяцев назад

    The white screen when you switch to browser is killing me

    • @RawCoding
      @RawCoding  6 месяцев назад +1

      Don’t leave the house or the sun might kill you

    • @urzaaaaa
      @urzaaaaa 6 месяцев назад

      @@RawCoding I only leave my house in the night. Days are for sleeping.

  • @kirillo3532
    @kirillo3532 6 месяцев назад

    Шикарный материал) спасибо, что освещаешь такие темы) Причем очень доступно и легко для усвоения темы)

  • @nullentrophy
    @nullentrophy 6 месяцев назад

    So, it behaves like this because http requests are handled asynchronously? -If they were handled synchronously this wouldn't be the behavior?- If they were handled synchronously, it would not have had scoped behavior? I am confused. It is unholy magic

    • @nullentrophy
      @nullentrophy 6 месяцев назад

      Checked out the implementation of AsyncLocal. It's just glorified Dictionary wrapper LOL

  • @mt89vein
    @mt89vein 6 месяцев назад

    This is called ambient context, and you should be careful with it. It may cause problems with testing and debugging