What is a Scoped .NET Dependency, and Why You Should Use Them

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

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

  • @prasad.kenkre
    @prasad.kenkre 14 дней назад

    The most practical & easy to understand example I have ever seen on this topic till date.

  • @SteveMaier
    @SteveMaier 2 года назад +12

    Thanks for updating the video, James. Too many times content creators make a video and never correct it if happens to have things that are wrong in it.

    • @JamesMontemagno
      @JamesMontemagno  2 года назад +3

      Thanks Steve! yeah, caught it early and I was like let's do this! hopefully youtube makes it easier in the future instead of uploading a full new video

  • @rikudouensof
    @rikudouensof 2 года назад +1

    I watched this when both James are from the past. Glad you made the changes. Gave me a wholesome understanding.

  • @johnatkins8012
    @johnatkins8012 2 года назад +5

    Thank you for making such great content and presenting it in an entertaining way. I’ve learnt loads from the MAUI workshop and your other videos. I’d love to see an in depth video on authentication especially using Google, Facebook Apple etc for the login.

  • @GarethBradley
    @GarethBradley 2 года назад

    Thanks

  • @xsasx
    @xsasx 2 года назад +1

    Thank you. Love the content and love seeing you learn in "real" time.

  • @cliffshivkar9948
    @cliffshivkar9948 8 месяцев назад

    Great vid as always!

  • @Timmygobang
    @Timmygobang Год назад

    Great video, refreshing to watch a video where someone explains things in simple terms :D

  • @fazmercs532
    @fazmercs532 2 года назад

    The best explanation I have ever seen.

  • @monsieurrodriguez9687
    @monsieurrodriguez9687 Год назад +1

    you explain so well

  • @queenstownswords
    @queenstownswords 2 года назад +2

    James. Please do a video on how to test (automated) .net MAUI applications. Thanks.

  • @akmalbukhariev7932
    @akmalbukhariev7932 Год назад

    Very very very good explanation thank you so much.

  • @pavelkravchenko2810
    @pavelkravchenko2810 2 года назад

    Now I get it. Thank you James!

  • @zhangyi5145
    @zhangyi5145 2 года назад

    excellent and precise example

  • @kerrysmith473
    @kerrysmith473 2 года назад

    Hi James,
    I love your videos. They are easy to follow and have helped me greatly to get started with Maui. I am trying to build a MAUI app that eventually will target Windows but will firstly target Mac. Can you do a video or point me to some articles on setting up background tasks for Mac and Windows under MAUI? Any help here would be greatly appreciated.
    Keep up the great work
    Kerry

  • @srijan105
    @srijan105 Год назад

    Simple and clear. Thanks,

  • @Spreck77
    @Spreck77 2 года назад +1

    Hey James, could you make a video on creating a new custom view control using Handlers, PropertyMappers, and CommandMappers? I've yet to come across an example that uses CommandMappers and there's very little documentation on them.
    Thanks for the videos.

  • @mohammedalsabahii2
    @mohammedalsabahii2 2 года назад

    Hey James, Can you make a video or tutorial about .Net Nanoframwork , thank you

  • @illiavolha5129
    @illiavolha5129 2 года назад +1

    And what is the right way to use DI with EntityFramework services in Blazor Server?
    Now I use Scoped, but there are a lot of posts and videos, where people describe that you should use DbContextFactory instead of DBContext. Also people are saying that using wrong type of service and DBContext instead of DbContextFactory can lead to buggy behavior of the app. Your Input about it will be really useful. I am talking specifically about Blazor SS.

  • @illiavolha5129
    @illiavolha5129 2 года назад

    Thank you

  • @zxph
    @zxph Год назад +1

    Also note that scoped dependencies are just reduced to singletons in Blazor WASM

  • @abdalghanialbiek8999
    @abdalghanialbiek8999 2 года назад

    Can you make video how to applicate MVI pattern in c# application

  • @escobar4599
    @escobar4599 2 года назад

    ah, the lonely oft-neglected service app ;)
    my current go-to service/long-running-process pattern is basically
    - a unified service/console lifetime
    - a background/hosted task
    - that task periodically performing work, call it once per hour. Where the 'work' is to create a new scope, and instantiate on that scope a 'session' of some form which will do the actual work. That 'session' is registered as a scoped service.
    This allows me to more reliable tear everything down after all the work is done for that iteration - releasing held resources while the app will basically be sitting idle until its next time to do work.
    Even when there is no great benefit from a resource perspective, its helpful to not have state/data that carries over from the 1AM run to the 2AM run.
    but UI is cool, and what most people work with - good explanations all around.

  • @keithsummers1889
    @keithsummers1889 2 года назад

    My VS Maui installation just blew up today when I updated it to 17.3.0 Pre4. It was looking for the new Android 33 release. I did a bunch of things and finally uninstalled -- but can't get it installed again. How frustrating...

  • @josuemercally
    @josuemercally Год назад

    I have a problem with login / logout feature on my Net MAUI app. If the user login with certain user, and logout and then login with another user, all my DI services have the previous user, no refresh them with the new data. I'm using Transcient as lifetime.

  • @guillermomaza7336
    @guillermomaza7336 Год назад

    Si quiero hacer algo tipo MessageBox. (Obvio que intento no usar JS por temas practicos). Seria indistinto que fuese Transient o Scoped?

  • @williamliu8985
    @williamliu8985 2 года назад

    One question, 2:18 it shows that Count property in CounterService doesn`t implement INPC interface, so it can still notify blazor page to update it`s value?

    • @JamesMontemagno
      @JamesMontemagno  2 года назад

      Blazor doesn’t need any notification change events it all happens automatically

  • @CoderDad
    @CoderDad 3 месяца назад

    Commenty McComment: Good post!

  • @DanSiegel
    @DanSiegel 2 года назад +1

    Nice edit! If you ever wanna chat about Prism let me know

  • @Dazza_Doo
    @Dazza_Doo 2 года назад

    Interesting: I'm Assuming Scope with Windows could mean this.
    You have tabbed views that you want to retain the information, at the same time you don't want it Global (singleton) and you don't want to loose the information (transient) if the page looses focus, for instance if the user is lost and tabbing to find the correct page again.
    Have I assumed correctly?

    • @FilipCordas
      @FilipCordas 2 года назад

      From what I get it will just resolve windows within a newly created scope so you will get a new service instance on every window and all the child components but different DI providers could interpret the scope in a different way. For example in AutoFAC you could have something owned on different levels depending on the setup. A scope just means where the first instance of created scope you could create it manually on a component basses.

  • @williamliu8985
    @williamliu8985 2 года назад

    James from future... That`s funny! 😀

  • @mubarekabdi
    @mubarekabdi 2 года назад

    Looks better without the lights as per my eyes 😂

  • @wizyconduccion3294
    @wizyconduccion3294 2 года назад

    Hey James Please send a greeting to my mom Marta, yes, like the Batman's mom