DEPENDENCY INJECTION in ASP.NET Core | Getting Started With ASP.NET Core Series

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 พ.ย. 2024

ความคิดเห็น • 182

  • @RahulNath
    @RahulNath  4 ปีที่แล้ว +9

    Source Code - rahulpnath.visualstudio.com/DefaultCollection/TH-cam%20Samples/_git/dependencyinjection

  • @shivamsoni6728
    @shivamsoni6728 4 ปีที่แล้ว +4

    One of the best tutorial for Dependency injection.
    No fun , only serious learnings across the video.

    • @RahulNath
      @RahulNath  4 ปีที่แล้ว

      Thank you Shivam and happy you found it useful

  • @abhishekanand6104
    @abhishekanand6104 3 วันที่ผ่านมา

    one of the best instructor i have seen ,very clean and clear concept ,Hats off sir

    • @RahulNath
      @RahulNath  2 วันที่ผ่านมา

      Glad you like it Abhishek - Do check out the ASP Series bit.ly/asp-net-core-series

  • @siddharth3837
    @siddharth3837 2 ปีที่แล้ว +1

    I like that you covered small details while explaining a concept. --- Give this man a raise (Obama pointing finger).

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว

      Thank you Siddharth. Hope you are enjoying the series bit.ly/asp-net-core-series

  • @arunsatyarth9097
    @arunsatyarth9097 4 ปีที่แล้ว +21

    You are the best teacher. You should consider making a Pluralsight or Udemy course.

    • @RahulNath
      @RahulNath  4 ปีที่แล้ว +4

      Thank you Arun. It means a lot and sure yes I am considering making a course too. Thanks again for your support!

    • @shubhamkoolwal139
      @shubhamkoolwal139 3 ปีที่แล้ว +1

      @arun satyarth completely agree with you

    • @mvdlele29
      @mvdlele29 3 ปีที่แล้ว +2

      no.. stay here..there we need to pay

  • @ahmedbasha4174
    @ahmedbasha4174 3 ปีที่แล้ว +5

    Amazing work, so far it's the best explanation for Dependency Injection.

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว +2

      That's so nice. Glad you found it useful Ahmed.

  • @samstring6827
    @samstring6827 3 ปีที่แล้ว +1

    Yours is the best channel to learn asp.net from, in the whole TH-cam. Keep it up. Thanks.

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว

      Wow, that made my day Sam! 😍 Thank you and happy you are liking it

  • @dotnetdeveloper288
    @dotnetdeveloper288 3 ปีที่แล้ว

    The best example of DI lifetime I ever see. Great Job....

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว +1

      That is so nice to know!

  • @suryak4224
    @suryak4224 5 หลายเดือนก่อน

    you are a good teacher for the people who have been already working as developer and refresh skills, but for beginners, your videos will be like bouncers over the head

    • @RahulNath
      @RahulNath  5 หลายเดือนก่อน

      Thank you Surya for your valuable feedback. Which group do you think you fall under? Can you give some details on why it would be bouncers over the headfor beginner and anything I could do better to improve that?

    • @suryak4224
      @suryak4224 5 หลายเดือนก่อน

      @@RahulNath Thank you for your response. I have been working as dotnet developer for almost 10 years and your tutorial really helped me to brushup skills on .net core api. Somehow I feel you are bit speed for beginers as you are moving quickly with navigations and code blocks.

    • @RahulNath
      @RahulNath  5 หลายเดือนก่อน

      @@suryak4224 Thank you again Surya for the reply. Do let me know if you have any topic/content suggestions as well.

  • @AnthonyInSanDiego
    @AnthonyInSanDiego 3 ปีที่แล้ว +6

    The best. I really really appreciate your clear explanation. I'm sure this channel is going to get much bigger. Thank you

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว

      Glad you think so Anthony!

  • @preetamjakhmola7521
    @preetamjakhmola7521 3 ปีที่แล้ว +2

    A video with 0 dislikes. nice thanks

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว

      Thank you Preetam. Happy you liked it😀

  • @samitkrghosh4388
    @samitkrghosh4388 2 ปีที่แล้ว

    Your really a good teacher I have ever seen in youtube channel . simplly you r great 👍👍

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว

      So nice of you and thank you Samit! The full ASP NET Series is available here bit.ly/asp-net-core-series
      Do let me know if you have any topic suggestions or feedback

  • @ruralsoftwareengineer3435
    @ruralsoftwareengineer3435 3 ปีที่แล้ว +1

    Superb. Clear explanation . Thanks for the details explananation

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว

      So happy these are helpful Balaji and thank you for letting know 😀

  • @amitlizza
    @amitlizza ปีที่แล้ว

    Very Precise, Simple and easy to understand .. really liked it.

    • @RahulNath
      @RahulNath  ปีที่แล้ว

      Thank you Amit! Do check out the full series bit.ly/asp-net-core-series

  • @pradipmanna6371
    @pradipmanna6371 4 ปีที่แล้ว +2

    Excellent. Thank you Rahul.

    • @RahulNath
      @RahulNath  4 ปีที่แล้ว +1

      Thank you Pradip!

  • @RyantheCanuckpirate
    @RyantheCanuckpirate ปีที่แล้ว

    Thank you for including a book recommendation for those who want to take a deep dive - I'm always looking for recommendations on resources and people are hesitant to make recommendations they don't personally directly benefit from

    • @RahulNath
      @RahulNath  ปีที่แล้ว

      Glad to hear that and thank you for letting me know. I do have some general book recommendation over at my blog (that has helped me as a dev)
      www.rahulpnath.com/blog/language-agnostic-books-for-every-developer/
      www.rahulpnath.com/blog/language-agnostic-books-for-every-developer-2/
      Hope you find them useful too!

  • @ashamarias
    @ashamarias 3 ปีที่แล้ว +2

    Great video, explanation and examples :)

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว

      Thank you! 😀

  • @volodyakachalka5187
    @volodyakachalka5187 2 ปีที่แล้ว

    You're great teacher, greetings from Poland :)

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว

      Thank you Volodya. Happy you find it useful. Hope you are liking the series th-cam.com/play/PL59L9XrzUa-nqfCHIKazYMFRKapPNI4sP.html

  • @starman9000
    @starman9000 4 ปีที่แล้ว +2

    Rahul, Thanks for detailed insight on DI!!

    • @RahulNath
      @RahulNath  4 ปีที่แล้ว

      Cool thanks!

  • @chetansn6
    @chetansn6 2 ปีที่แล้ว

    Good job, detailed explanation which helps in realtime development.

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว

      Glad it was helpful! Do check out the full series here bit.ly/asp-net-core-series

  • @antarikshverma8999
    @antarikshverma8999 2 ปีที่แล้ว +1

    Thank you for great videos Rahul !

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว

      Glad it was helpful!

  • @alfullard8887
    @alfullard8887 3 ปีที่แล้ว +2

    As always.. brilliant content with a great explanation. Thanks.

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว

      Awesome thank you! Glad you found it useful 😀

  • @vinodcd
    @vinodcd 3 ปีที่แล้ว +1

    Very good explanation!!

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว

      Thank you Vinod!

  • @juhairahamed5342
    @juhairahamed5342 2 ปีที่แล้ว +1

    Thanks again for good explanation

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว

      Always welcome. You might like the other videos in this series too bit.ly/asp-net-core-series

  • @jmsatheesh1
    @jmsatheesh1 3 ปีที่แล้ว

    You are amazing man. No one else explained this in easy and understandable way

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว +2

      Glad to hear that Satheesh 😀 You will definitely like other videos in this series then th-cam.com/play/PL59L9XrzUa-nqfCHIKazYMFRKapPNI4sP.html
      Do check them out and let me know. Also let know if you want any particular topics covered.

  • @sree7986
    @sree7986 3 ปีที่แล้ว

    nice explanation Rahul, i really liked the diagram showing the lifetimes

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว

      Happy you liked it and found it useful.

  • @DP-mo9gi
    @DP-mo9gi 2 ปีที่แล้ว

    I've no words to explain how good You explain a Complicated concept this much Easily, your channel is going to be very big in the future, All the best Sir. Love from INDIA ♥♥♥.

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว +1

      Thanks a lot! Hope you are enjoying the full series here bit.ly/asp-net-core-series

  • @deivamanidhandabani9505
    @deivamanidhandabani9505 2 ปีที่แล้ว +1

    Good explanation Thanks Rahul.

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว +1

      Happy you found it useful - Do check out the full series in case you haven't already bit.ly/asp-net-core-series

    • @deivamanidhandabani9505
      @deivamanidhandabani9505 2 ปีที่แล้ว +1

      @@RahulNath sure Rahul thanks

  • @saturninramirez1107
    @saturninramirez1107 2 ปีที่แล้ว +1

    very good explications , thanks

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว

      Glad it was helpful! The full series is here bit.ly/asp-net-core-series

  • @ezhisaivallabanr3189
    @ezhisaivallabanr3189 2 ปีที่แล้ว +1

    Thanks for clear explanation

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว

      You are welcome and do check out the full series here bit.ly/asp-net-core-series

  • @thomasmunguya2207
    @thomasmunguya2207 3 ปีที่แล้ว +1

    You explain so well. I'm glad I stumbled upon your channel. Keep it up.

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว +1

      Thank you Thomas and welcome to the channel. For ASP NET do check out my series th-cam.com/play/PL59L9XrzUa-nqfCHIKazYMFRKapPNI4sP.html
      Do let me know if there are specific areas that you would like to be covered.

  • @kiranshetty4316
    @kiranshetty4316 3 ปีที่แล้ว +1

    Rahul , Thanks for the Video . I have one request Can you pls explain with Video Why DBContext LIfetime is Scoped Bydefault why not they made it with Transient or Singleton And what happens if doing so .

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว +1

      Thanks again Kiran and happy this helps. With web applications since you want the updates the updates to be isolated to your each of the request that comes in, it helps DBContext being Scoped. If they are SIngleton you can end up updating same objects from multiple threads etc. Let know if that helps.

  • @Blr046
    @Blr046 3 ปีที่แล้ว +1

    I really appreciate your work. Thank you so much for sharing your knowledge. I am currently using Visual Studio 2022. Lot of things changed, there is no startup.cs. Would it be possible to update your videos for Visual Studio 2022 ?

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว

      You're very welcome! Yes already on it - Been a bit away from TH-cam, will be back soon!

  • @anurag3487
    @anurag3487 3 ปีที่แล้ว +1

    crisp and clear explanations Rahul, thank you. What are we trying to achieve by ISingletonInstance in the video?

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว +1

      Mostly to demo the different lifetime scopes. Just to make aware of them. It's rarely I've had to use Singleton lifetime scope.

    • @anurag3487
      @anurag3487 3 ปีที่แล้ว +1

      @@RahulNath thank you. Yes scoped is what I have used mostly.

  • @patrickmullen5167
    @patrickmullen5167 3 ปีที่แล้ว +1

    Great video 👍

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว +1

      Thank you for watching other videos in this series and leaving back a comment! Hope you like the rest too and more to come 😀

    • @patrickmullen5167
      @patrickmullen5167 3 ปีที่แล้ว

      @@RahulNath your videos are the right level of concise and detailed, and always clear. I’ve watched a few, and look forward to watching more. Best wishes 😊

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว +1

      @@patrickmullen5167 Thank you! 😀

  • @keithmar5996
    @keithmar5996 2 ปีที่แล้ว

    Nice job. You're a great explainer.

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว

      Thank you Keith!! Do check out the full series here bit.ly/aws-net-series
      I'm sure you will like them 😀

  • @respectandcare-e7g
    @respectandcare-e7g 2 ปีที่แล้ว

    Pure Gold Content. Thanks a lot man for all of the great content you make.

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว

      My pleasure Sidhant! The full series is here in case you haven't seen th-cam.com/play/PL59L9XrzUa-nqfCHIKazYMFRKapPNI4sP.html

  • @igorlira7330
    @igorlira7330 2 ปีที่แล้ว +1

    This is just amazing, thank you very much!

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว

      Glad you like it!

  • @deivamanidhandabani9505
    @deivamanidhandabani9505 2 ปีที่แล้ว +1

    Please post the video for SOLID principles with the real time scenarios implementation
    Specifically Open/Closed and Liskov Substitution Principle

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว

      Good suggestion, thank you!

  • @IndiaThatIsBhaarat
    @IndiaThatIsBhaarat 4 ปีที่แล้ว +2

    Good one!!

  • @thinklive678
    @thinklive678 3 ปีที่แล้ว +2

    Hey Rahul,
    Could you please make video in which existing asp.net core application move from http to https for all environment.
    Many Thanks for your help in Advance.

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว

      Hey Ravi, This would have little changes on the ASP Net side itself and more on how you and where you are hosting, what certificates you are using, etc. Can you provide more details on what issue you are facing?

    • @thinklive678
      @thinklive678 3 ปีที่แล้ว

      @@RahulNath I need set path for self signed certificate for dev and higher environment where I am facing issue also in the configure and configureService method code change for https. If you can guide me there or any link or pdf is there then it would be highly appreciated.

  • @rohan4rich
    @rohan4rich 3 ปีที่แล้ว +2

    Hello Rahul Sir, I have one question can we use service singleton instance in any other class (other than controller) , for example I have ValueController - BusinessOperation class(custom logic) - database operation class and here I have to create Singleton service instance of Database operation class and use it in BusinessOperation class .

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว

      Yes you can inject Singleton to other than controller. Make a class singleton only if absolutely required.

  • @srinivasrapaka4729
    @srinivasrapaka4729 ปีที่แล้ว

    Nice Explanation bro.to make 15:15 the compiler happy :)

    • @RahulNath
      @RahulNath  ปีที่แล้ว

      Glad you liked it! Hope you are enjoying the series bit.ly/asp-net-core-series

  • @pkapilsrisai4737
    @pkapilsrisai4737 2 ปีที่แล้ว

    Love the way you explain.....

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว +1

      Thanks a lot 😊The full series is there in case you haven't come across it bit.ly/asp-net-core-series

  • @josephinekwakye4495
    @josephinekwakye4495 2 วันที่ผ่านมา

    You're really good🔥

    • @RahulNath
      @RahulNath  2 วันที่ผ่านมา

      Thank you josephine - Do check out the ASP Series bit.ly/asp-net-core-series

  • @rangerpedia3057
    @rangerpedia3057 3 ปีที่แล้ว

    Awesome sir👍

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว

      Thank you Ranger. Do checkout my ASP NET Core Series here th-cam.com/play/PL59L9XrzUa-nqfCHIKazYMFRKapPNI4sP.html
      I'm sure you'll like it. And call me Rahul 😀

  • @raghavambashta4564
    @raghavambashta4564 6 หลายเดือนก่อน

    Super Explanation

    • @RahulNath
      @RahulNath  6 หลายเดือนก่อน

      Glad you liked it Raghav! Hope you are enjoying the series bit.ly/asp-net-core-series

  • @leanhxuan4931
    @leanhxuan4931 2 ปีที่แล้ว

    Hello Rahul, I eally appreciate your clear explanation but have a question: After override IFunctionsHostBuilder at startup; When I call azure function from client side with url and appkey then function fails with error message like this: Microsoft.AspNetCore.Authentication.Core: No authentication handlers are registered. Did you forget to call AddAuthentication().Add[SomeAuthHandler]("WebJobsAuthLevel",...)?. Please help me know how the way to fix this trouble.

  • @zeeshanbage4267
    @zeeshanbage4267 3 ปีที่แล้ว

    why I did not found you earlier. Making my interview preparation easy with each video. Great explanation not just this video but all.

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว +1

      Glad you like it Zeeshan. Good luck with your interviews!

    • @zeeshanbage4267
      @zeeshanbage4267 3 ปีที่แล้ว

      I had interview with thoughtworks this week.. explained them dependency injection and middle were for 15 to 20 mins.. start-up class also..got cleared that round waiting for final round now. Thank you

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว +1

      @@zeeshanbage4267 Great to hear that Zeeshan. Good luck and do let me know how that goes.

  • @Aman-x5g
    @Aman-x5g 4 หลายเดือนก่อน

    Amazing

    • @RahulNath
      @RahulNath  4 หลายเดือนก่อน

      Thank you Aman! Do check out the ASP Series bit.ly/asp-net-core-series

  • @centrilla1169
    @centrilla1169 3 ปีที่แล้ว

    This is a gem...

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว +1

      Happy to hear that ! Do check out the full series here bit.ly/asp-net-core-series
      Do let know in case you get to watch any of it 😀

  • @TheMrjuanblack
    @TheMrjuanblack 3 ปีที่แล้ว

    Ah man, I have to ruin the 420 like count because you deserve one more like. Great video!

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว +1

      Glad you liked it Juan! Do check out the full series here if you haven't already bit.ly/asp-net-core-series

    • @TheMrjuanblack
      @TheMrjuanblack 3 ปีที่แล้ว +1

      @@RahulNath Will do!

  • @boggybayouboy
    @boggybayouboy 2 ปีที่แล้ว

    This is great!

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว

      Thank you John!!

  • @pradipmanna6371
    @pradipmanna6371 4 ปีที่แล้ว +1

    Hi, sorry if the question is silly. I want to use a value from an injected dependency, say using IConfiguration I want to retrieve a config value in a static class / static property. Is that really possible? Actually, I want to create a 'GlobalHelper' to store all required static vars and make them available to every resource that needs it. Thanks.

    • @RahulNath
      @RahulNath  4 ปีที่แล้ว +1

      Not sure why you want it as a static class/property. To use configuration values you can use the Options Pattern. Learn more about it and how to use it here -th-cam.com/video/SizJCLcjbOA/w-d-xo.html
      Let know if that helps solve your problem. If not kindly detail out the problem you are trying to solve (not the how) and I can try help.

    • @pradipmanna6371
      @pradipmanna6371 4 ปีที่แล้ว +1

      Okay, thank you.

  • @lyrixghgc
    @lyrixghgc 4 หลายเดือนก่อน +1

    Great tutorials. Could you zoom in a bit when making your videos as the text appear so small and blurry please? Thanks

    • @RahulNath
      @RahulNath  4 หลายเดือนก่อน

      Thank you eddie for the feedback. Haven't had anyone tell that before. May I ask what device/where you are watching this? Also what's the resolution of the video that youtube shows when you view it?

    • @lyrixghgc
      @lyrixghgc 4 หลายเดือนก่อน

      @@RahulNath Thanks for responding. I'm watching on a MacBook Pro. The problem was the video resolution. Thanks for pointing that out.

    • @RahulNath
      @RahulNath  4 หลายเดือนก่อน +1

      @@lyrixghgc Glad it’s resolved! Hope you are liking the content . Do let know if you have any feedback 👍

  • @callegarip
    @callegarip 3 ปีที่แล้ว +1

    Once again, what a wonderful teacher you are man. Thank you for all your videos.
    I have a question, so let's say in a multi layer application, what is the best way of passing information from the Web Api controllers to the other layers, such as BLL or DAL? I now know how to inject dependencies to my controllers in the API project (thank you again). Now, I want to pass/inject the logged User information from the API to my BLL project and I am wondering if there is a best way to do this. At the moment I have a UserDTO class and fill this object in the same api controller then pass it to down to my BLL layer. How would you handle it?

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว

      Glad you are finding these useful Victor!
      Did you get a chance to watch this video? th-cam.com/video/XE1w52pNYr8/w-d-xo.html
      Even though the solution used is a AWS template, much of the patterns(using Mediatr + Commands/Query) is what I usually use for the applications I built. Majority of the time I see this working well.
      When passing the information from the host application (in this case API host) I pass the information via the Command/Query object. Is this something that fits into your model?

    • @callegarip
      @callegarip 3 ปีที่แล้ว

      @@RahulNath I just watched it. I don’t think it will fit. My application is multi layer but does not need all of this. Really all I was asking is how to pass information down to the business layer as parameters. I have a react application where I login with a user and this user context information is only available in the api because I can use the httpcontext. The BLL and DAL layer cannot Accra to the httpcontext. So what I was asking is what is the best way to pass the user information down to those layers. Right now I have to instantiate my UserDTO and fill the object on every api controller so I can send that object down to the other layers as a parameter in order to user the user information. This works for me but I feel like I am not doing this the right way.

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว +1

      ​@@callegarip Sorry Victor, missed out on replying earlier. One pattern I can immediately think of is to have a interface defined in Domain Layer (IUserContext), keep this at a request scope in DependencyInjection and set up the content details required from inside your API layer, possibly in a middleware, so that every request will have this auto-populated. You could expose a SetContext method on the interface and use it in the middleware. Anywhere you need the context you can then inject in the IUserContext and retrieve the values from there. So then you don't have to explicitly pass it along with each function call parameter. Let me know if that makes sense. I will think more about this and possibly do a video around this.

    • @callegarip
      @callegarip 3 ปีที่แล้ว +1

      @@RahulNath thank you. Yeah that sounds something I can do. Anyways, a video about this would be much appreciated. 😊

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว +1

      @@callegarip Sure I will add it to my list. Let me know how it goes in case you get to give this a try. Also do drop in if you have other topic suggestions here th-cam.com/users/postUgzvsuKE7KLhPaMzCMN4AaABCQ

  • @thefront5871
    @thefront5871 2 ปีที่แล้ว +2

    FYI, Startup.cs is missing because it got merged into the Program.cs file. Hope that helps someone!

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว +1

      Thank you for pointing it out - Yes this video was made with .NET 3.1. With .NET 6 by default, it's merged but the overall concept still remains the same.

  • @AbdullahSajjad-p4p
    @AbdullahSajjad-p4p 10 หลายเดือนก่อน

    That’s Gold 🤩

    • @RahulNath
      @RahulNath  10 หลายเดือนก่อน +1

      Glad you liked it. Do check out the full series bit.ly/asp-net-core-series

    • @AbdullahSajjad-p4p
      @AbdullahSajjad-p4p 10 หลายเดือนก่อน

      @@RahulNath Surely I’m following it. I am an experienced frontend developer having some nestjs backend experience but want to move to full time backend development and would love to use C# for that to get into enterprise level tech and your series is really helpful in understand dotnet concepts.

    • @RahulNath
      @RahulNath  10 หลายเดือนก่อน

      @@AbdullahSajjad-p4p Glad to hear that. Do let know if you have any questions or topic suggestions.

  • @NK-xw4uu
    @NK-xw4uu 3 ปีที่แล้ว

    Every request to the controller will result in creation of new DependencyService1 and DependencyService2 objects because they are registered as Transient. However within the DependencyService1/2 code you have used various types of IOperations (registered as transient/scoped/singleton). In the case of scoped and singleton, how does the program ensure that within every new instance of DependencyService1/2 you get same instance of scoped (in the single request) and same instance of singleton (across all requests)? Is this the functionality of the DI container's internal implementation? Also, is this an example of multilevel DI that you have shown? Level 1 is the DependencyService1/2 and Level 2 is the Operation.

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว

      Hey Nachiket, The examples shows are purely for representational purposes. Is there a real world example/issue that you are facing? If you provide more details on what you are trying to solve I could try and help.

  • @AkashTripathi5
    @AkashTripathi5 2 ปีที่แล้ว

    Hi Rahul, how can we Inject parameterized constructor using dependency injection?

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว

      Are you looking for some thing like this docs.autofac.org/en/latest/register/parameters.html? I think it's not supported with default DI. Check out some guidelines here on Default service container replacement docs.microsoft.com/en-us/dotnet/core/extensions/dependency-injection-guidelines?WT.mc_id=AZ-MVP-5003875#default-service-container-replacement

  • @RoySourav
    @RoySourav 3 ปีที่แล้ว

    awesome

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว

      Thank you Sourav and glad you like it. Happy you are checking out the other videos. Do let me know if you have any specific topic suggestions to be covered.

  • @Lunolux
    @Lunolux ปีที่แล้ว +1

    nice

    • @RahulNath
      @RahulNath  ปีที่แล้ว

      Hope you are enjoying the full series bit.ly/asp-net-core-series

  • @rohitshaw9191
    @rohitshaw9191 5 หลายเดือนก่อน

    I have just started learning .net core. I saw that you have used Startup.cs file for declaration of the service lifetime, But Startup.cs file is discontinued from .net 6. How do we manage that?

    • @RahulNath
      @RahulNath  5 หลายเดือนก่อน

      Hey Rohit, Hope you are finding .NET Core interesting. Yes you are right the Startup class is no longer part of the default template. I had made this video on .net core 3.1 when it existed. You can learn more about it in this video here th-cam.com/video/bSwqkKKV7iM/w-d-xo.htmlsi=rAgktdmujWLzNWG0
      Let me know if that answers your question. Happy to assist if you have more questions.

  • @srikanthek737
    @srikanthek737 2 ปีที่แล้ว

    Thanks for the video, i have a question, say i have a class library without any startups.cs or program.cs , is it possible to implement dependency injection without startup.cs or program.cs ?

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว +1

      Thank you. Is it a reusable/shared DLL that you are creating? I prefer having the host application dictate the DI framework rather than a DLL forcing to use a specific one. If you provide more details on your use case maybe I can help more.

    • @srikanthek737
      @srikanthek737 2 ปีที่แล้ว

      @@RahulNath its a reusable DLL, shared across different applications, i cannot add host files or program.cs

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว

      @@srikanthek737 It's better to have a readme/doc for the DLL showing how to register the classes in it. You could add extension methods for it too (preferably in a separate DLL). If you look at any .NET libraries out there they follow a similar pattern. Hope that helps.

    • @srikanthek737
      @srikanthek737 2 ปีที่แล้ว

      @@RahulNath actually i was wondering is that possible to implement dependency Injection just within DLL library without any startup.cs or program.cs.
      If possible can you please create one such video which might helps many people

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว

      @@srikanthek737 It will be up to the host to inject the dependencies to the DLL since that will be the context in which your DLL will be used. As long as you are injecting in the dependencies via the constructor, why do you want DI in your DLL?

  • @deivamanidhandabani9505
    @deivamanidhandabani9505 2 ปีที่แล้ว

    Could you please explain the scenarios when should use Azure Web Jobs Vs Azure Functions Vs Logic Apps
    and need the scenario to use Azure Service bus Queues and Topics
    Please advise.

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว +1

      This is a good article that covers some of those questions docs.microsoft.com/en-us/azure/azure-functions/functions-compare-logic-apps-ms-flow-webjobs?WT.mc_id=AZ-MVP-5003875

    • @deivamanidhandabani9505
      @deivamanidhandabani9505 2 ปีที่แล้ว

      @@RahulNath Thanks Rahul 😊

  • @muhammadayazmehmoodabdulha6361
    @muhammadayazmehmoodabdulha6361 2 ปีที่แล้ว

    Why we use Interfaces for dependency injection or repository patten? is there any other way to achieve this ?

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว +1

      Mostly because with C# you can easily swap interface implementations and it helps when testing, mocking etc. With classes you are stuck with that particular implementation. It depends on what you are use cases are. Does that help? Feel free to ask if you have more questions.

    • @muhammadayazmehmoodabdulha6361
      @muhammadayazmehmoodabdulha6361 2 ปีที่แล้ว +1

      @@RahulNath Thanks a lot Sir, this Make sense.

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว +1

      @@muhammadayazmehmoodabdulha6361 Perfect and you can call me Rahul 🙂

  • @sakathvenu
    @sakathvenu 3 ปีที่แล้ว

    Gold!

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว

      Thank you😀

  • @netscapeinthewood3345
    @netscapeinthewood3345 2 ปีที่แล้ว +1

    Thanks 😎

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว

      Welcome 😊Do check out the full series if you haven't already bit.ly/asp-net-core-series

  • @rahul_salokhe
    @rahul_salokhe 2 ปีที่แล้ว

    Hi,
    How to update ASP.Net site dll without stopping site?

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว

      It depends - what is your current setup? How is the site hosted? If you are on Azure, easiest might be to look at deployment slots docs.microsoft.com/en-us/azure/app-service/deploy-staging-slots

  • @aaroncastanos4549
    @aaroncastanos4549 3 ปีที่แล้ว +1

    now i can start

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว +1

      Hope it helped Aaron

  • @pritishranjan
    @pritishranjan 4 ปีที่แล้ว +2

    What is a dependency implemented class requires a another Dependency type as a parameter..as Guid simple..what is a dependency requires a dependency type as a parameter

    • @RahulNath
      @RahulNath  4 ปีที่แล้ว +1

      The DependencyService1 (and 2) takes in other dependencies via it's constructor - rahulpnath.visualstudio.com/DefaultCollection/TH-cam%20Samples/_git/dependencyinjection?path=%2FDependencyService1.cs
      Also, the Operation class takes in a Guid parameter which we saw (12:15) in the SingletonInstance case being injected in using the factory constructed method.
      If you are looking to inject in config like values you can also use the Options pattern - docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/options?view=aspnetcore-3.1
      All dependencies need not be injected in via the constructor, you can also see if it makes more sense to pass it as a function parameter when using the object.
      Let me know if that helps. If not please give more details about your scenario and I am happy to provide more details.

    • @pritishranjan
      @pritishranjan 4 ปีที่แล้ว +2

      @@RahulNath Thanks for the response...I find ur videos well explained...keep making ...as I am a beginner and moving from .NET to .NET Core..thanks

    • @RahulNath
      @RahulNath  4 ปีที่แล้ว +1

      @@pritishranjan Awesome thanks. Do let know if you want any particular topics covered.

    • @pritishranjan
      @pritishranjan 4 ปีที่แล้ว

      @@RahulNath ya .. please consider these topics for videos
      1.Repository Pattern with EF Core
      2.Extending , Configuring, and Modifying ASP.NET Identity for auth
      3.Adding Razor pages to a Existing ASP.NET Core web project
      4.How to keep good relations between Model, ViewModel and DTOs

    • @RahulNath
      @RahulNath  4 ปีที่แล้ว +1

      Pritish Ranjan Noted thanks!

  • @anupchandran
    @anupchandran 2 ปีที่แล้ว

    Thank you :)

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว

      You're welcome Anup! Hope you are enjoying the series

  • @theyoutuber273
    @theyoutuber273 3 ปีที่แล้ว

    You are awsome sir! You are fucking Awsome!

    • @RahulNath
      @RahulNath  3 ปีที่แล้ว

      Thank you 😀

  • @ryanleemartin7758
    @ryanleemartin7758 2 ปีที่แล้ว +1

    I appreciate this video but man do I hate how .net does this stuff. My eyes glaze over at all this ServiceProvider, ServiceCollection, IOperation... stuff. I hate it so much lol

    • @RahulNath
      @RahulNath  2 ปีที่แล้ว +1

      Hahaha 😆