AsyncLocal and Scoped Services in ASP.NET Core

Поділитися
Вставка
  • Опубліковано 14 тра 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-coding.dev
    Buy my Merch 🛒 shop.raw-coding.dev
    Join the Community 💬 / discord
    Tweet Tweet 📣 / anton_t0shik
    Tune in LIVE! 🎥 / raw_coding
    #csharp #async

КОМЕНТАРІ • 13

  • @ivandrofly
    @ivandrofly Місяць тому +11

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

  • @cocoscacao6102
    @cocoscacao6102 Місяць тому

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

  • @diegoronkkomaki6858
    @diegoronkkomaki6858 Місяць тому +1

    Good stuff, learned a lot.

  • @binoypatel09
    @binoypatel09 Місяць тому

    Nicely explained, thanks for the great content

  • @jamesarceri5540
    @jamesarceri5540 Місяць тому

    Good stuff as always sir.

  • @kirillo3532
    @kirillo3532 Місяць тому

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

  • @piotrc966
    @piotrc966 Місяць тому

    Really great!

  • @urzalukaskubicek9690
    @urzalukaskubicek9690 Місяць тому

    The white screen when you switch to browser is killing me

    • @RawCoding
      @RawCoding  Місяць тому +1

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

    • @urzalukaskubicek9690
      @urzalukaskubicek9690 Місяць тому

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

  • @nullentrophy
    @nullentrophy Місяць тому

    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 Місяць тому

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

  • @mt89vein
    @mt89vein Місяць тому

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