How to use Scoped Services Lifetime in ASP.NET Core

Поделиться
HTML-код
  • Опубликовано: 7 янв 2025

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

  • @kebakeba6864
    @kebakeba6864 2 месяца назад

    For several years ive been struggling those parameters passing everywhere, so i "invented" those scoped states. After that ive been thinking how to play with those states. What i came with was "State providers" like a implementation for extracting value fron the route itself, or for lazy execution to avoid those complexity - it all for the ability ti inject state directly into its consumer without passing parameters. After a few moths i fell defeated, and how i found your video and thats a magic kick to start anew. Thanks a lot, this things are the things i think about all the time

    • @kebakeba6864
      @kebakeba6864 2 месяца назад

      upd: seems like it doesnt help me, sadly. doesnt work in the case i pass state to a class that is called inside some other class

    • @RawCoding
      @RawCoding  2 месяца назад

      Can you give a more detailed example?

  • @bedrichkletorny4893
    @bedrichkletorny4893 7 месяцев назад

    Great video! I realized that I did not understand scoped services and it`s proper usage fully before I saw your explanation.

  • @umpgod7573
    @umpgod7573 7 месяцев назад +1

    why did you use singleton for WithTenantScope?

  • @amnesia3490
    @amnesia3490 7 месяцев назад

    My boi at it again

  • @meetingattender8132
    @meetingattender8132 5 месяцев назад +1

    Pretty sure this guy was born knowing all these things already

  • @mibli2935
    @mibli2935 7 месяцев назад

    Amazing, as usual.

  • @andrewiecisa2907
    @andrewiecisa2907 7 месяцев назад +2

    Wouldn't it be easier to use keyed service for tenant db?

    • @RawCoding
      @RawCoding  7 месяцев назад

      Nope keyed services solve a different problem

    • @nitrovent
      @nitrovent 7 месяцев назад

      They keys are static or in other words defined at startup when registering the service. You would need to restart your application for a each new tenant (to stay with the example from the video)

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

    What IDE do you use to work with C#? Today mac os users can't installl offically Visual Studio

    • @meetingattender8132
      @meetingattender8132 5 месяцев назад

      He has the visual studio code from Microsoft private repos, he compiles and uses his own custom VS2024 edition.

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

    Bro can grow a beard wow

  • @unskeptable
    @unskeptable 3 месяца назад +2

    This is a bit all over the place. Hard to follow