Skip to content
UdemyIt & SoftwarePaid courseAll LevelsCertificate

Dependency Injection in .NET MVC (.NET Core) (Udemy.com)

Learn the basic foundation of Dependency Injection in ASP.NET Core / .NET 5 web applications.

Created by: Bhrugen Patel

Last updated February 2026

icon
What you will learn

  • Dependency Injection in .NET 5 (.NET Core)
  • Need for Dependency Injection
  • Service Lifetime for Dependency Injection
  • Injecting services in Middleware
  • Injecting services in Views
  • Injecting services in Controller/Actions
  • Different ways to register services
  • Registering interface multiple times
  • Adding, removing and replacing service registration
  • Register multiple implementations
  • Framework services like ILogger
  • Custom repository pattern

icon
Course Description

Dependency Injection is one of those terms that are used very often and are not understood most of the time.

This course will teach you everything you need to know about using dependency injection in ASP.NET Core. The skills you will learn will help you to build and architect complex ASP.NET Core applications that make full use of dependency injection. We will start with the basics of Dependency Injection and then we would dive into advanced concepts.

In old times we had to use third-party libraries for dependency injection but with .NET Core , dependency injection has been an integrated part of the .NET and it has great capabilities!

We will learn about all the topics that are needed to master Dependency Injection. By the end of the course, you will be fluent with all questions when it comes to dependency injection.

Discover why Dependency Injection is essential for modern .NET development and how it solves real-world problems like tight coupling and difficult testing. You'll start with the core concepts, understanding the Dependency Inversion Principle and how DI fits into SOLID principles.

Master the built-in .NET Dependency Injection container, learning how to register services with different lifetimes (Transient, Scoped, and Singleton) and understand when to use each. You'll explore constructor injection, property injection, and method injection patterns, knowing exactly when each approach is appropriate.

Move beyond the basics with advanced scenarios including working with multiple implementations, using factory patterns, handling complex object graphs, and implementing decorators. You'll learn how to configure third-party DI containers like Autofac when you need more advanced features.

Apply DI in real-world contexts across ASP.NET Core applications, including MVC, Web APIs, and Blazor. You'll see how to inject dependencies into controllers, services, middleware, and background services, while following architectural patterns like Repository and Unit of Work.

icon
Udemy Discount

The discount is applied through our link. Open the course from here and Udemy's current promotional price is applied at checkout on most courses, no code to type.

Some courses are excluded from Udemy's promotions. If the price does not drop, clear your browser cookies and use the button again.

icon
Instructor Details

Bhrugen Patel

I am a passionate and creative software engineer with a strong focus on simplicity and thorough details. I have been programming since high school and I have been involved with multiple web and desktop using .net.

I have a master's of science degree in computer science and a Bachelor of Computer Engineering. I also have many years of experience with .NET C# and .NET MVC. I enjoy teaching along with my full-time job.

For me, the most important part about writing and teaching code is to eliminate the hardships of every student out there who is willing to learn but cannot find adequate resource which is easy to understand. Coding is a way to be creative and have fun!

icon
More courses by Bhrugen Patel

$84.99

$99.99

$15.00

$79.99

$19.99

$69.99

icon
More IT & Software courses

$49.99

$19.99

$64.99

$64.99

$20.00

$59.99

icon
Reviews

4.6

1,316 ratings on Udemy

Select a bar to show only those reviews.Select the bar again to show every rating.

By Pieter van Wyk on 6/19/2024

The course content is very good. I want to share some feedback regarding the course narrative. I’ve found that the narrative can be somewhat distracting, which sometimes makes it challenging to fully absorb the material. Additionally, the spoken language, while clear, isn't as conducive to easy listening for extended periods. One suggestion that might enhance the learning experience is to consider incorporating AI-generated voices. These voices can be fine-tuned to be more neutral and consistent, potentially making the audio easier to listen to and understand. Many modern AI voices are remarkably natural-sounding and can help maintain learner engagement throughout the course.

By Sarye Haddadi on 2/16/2022

Thank you for the course, I feel very confident now. The course gives practical tips on service lifetime, and at the end, a way to hide all the service injections behind a single method. - For those coming from another framework, please note that the Dependency Injection Container is built-in in .Net, nevertheless, the course longs only 3 hours and contains a great amount of practical usage and theorical content. I am very willing of these small .Net focused courses. An idea that interests me for another course: a master course on logging (elastic search, azure).

By Manuel Morán Núñez on 7/4/2021

The course could have been focused to dependency injection itself, on a more general purpose way, instead of focusing on ASP.NET, which I do not use on my day to day operations. So, for me, this course was confusing, since I had to pay more attention to the ASP.NET side of things to understand why the application was setup the way it was, and not so much on the dependency injection concepts that I really needed to learn and apply.

By Ricardo Rangel Ramírez on 5/6/2021

I really liked this course, it is perfectly explained and I learned details about the configuration of the services that otherwise would have been more difficult. I recommend this course to anyone who wants to reinforce their knowledge of Dependency Injection or even deepen in this topic. Thanks Bhrugen.

By Matthias Bayer on 1/11/2021

Bhrugen is a very good instructor, although he has an accent, he manages to convey what you need to know in a clear and structured way. This course focuses on dependency injection for ASP.NET, it touches some other areas, but only slightly. I already went through ASP.NET courses (from Bhrugen and others) and I still learned some things regarding DI from this course. For those of you who want to see some edge cases in ASP.NET service injections I can recommend this course. If you are expecting to understand other ASP.NET aspects you should go to more extensive or broader courses first and then return to this one. Thank you Bhrugen for yet another very good course!

By Caia Alexandru Radu on 5/19/2020

I liked the way it was explained and that it didn't go into cluttered and unnecessary details. in the title it was written DI in .Net 5 but everything from the course works in .Net Core 3.1 so is not a course about new features from .Net 5 .

By Rakesh Jose on 5/14/2020

before I watch this course, I had some high level understanding about .NET core Dependency Injection . After completing this course, I learned a lot more in detail about DI in .NET core. Being a senior developer this is going to help me a lot moving forward.

By Chafford 100 on 5/3/2020

Excellent course just to make sure you are not missing anything on dependency injection. Maybe a little less entity framework as the course could quite easily have demonstrated without. However, the explanations were very clear. Nice quick little course.

By Charles Polson on 4/29/2020

Loved this! Very detailed and specific to the topic. Section 5 item 44 Bonus - Repository Demo: the volume was turned down - but that is the ONLY deficit this course has and that can be mitigated with careful listening. This guy knows his stuff! Great course!

By Anton Bloise on 4/26/2020

This is a good refresher of concepts so far. Even if you are not sure what this course is about, take it if you are serious about programming, these concepts are really important. Bhrugen is great at explaning, and there are lots of resources that he makes available to consult.

Showing all 10 reviews on CourseDuck

Read all 1,316 reviews on Udemy

icon
Quality Score

No CourseDuck member has rated this course yet. Taken it? Give each part a thumbs up or down.

Content Quality
/
Video Quality
/
Qualified Instructor
/
Course Pace
/
Course Depth & Coverage
/

Overall Score : 92 / 100