Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Dependency Injection in .NET MVC (.NET Core)
Rating: 4.5 out of 5(1,288 ratings)
6,308 students

Dependency Injection in .NET MVC (.NET Core)

Learn the basic foundation of Dependency Injection in ASP.NET Core / .NET 5 web applications.
Last updated 2/2026
English

What you'll 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

Course content

5 sections49 lectures2h 58m total length
  • Welcome to course2:04
  • Topics covered2:08
  • Project Resources (Github)2:02
  • Get most out of the course0:44
  • Udemy Review0:25
  • Dependency Injection Intro 13:52

    Discover how ASP.NET Core uses dependency injection and an inversion of control container. Register dependencies once, and let the container create, inject, and dispose them into pages.

  • Dependency Injection Intro 23:08
  • Tools Needed2:25

    learn the essential tools for this dependency injection course: Visual Studio 2019 or preview, SQL Server 2017–2019, and the latest .NET 5.

  • Create Project2:23

Requirements

  • Fundamentals of ASP NET Core MVC
  • Basics of SQL Server
  • Basic HTML/CSS knowledge

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.

Who this course is for:

  • C# Developers
  • Anyone interested in learning Dependency Injection in .NET Core / .NET 5