Skip to main content
c# tag for formatting; cleaned up grammar of question
Source Link
user53019
user53019

How does the construction injection work with dependency injection?

I haveWith the following code:

public class AdvancedSearchController : Controller
{
    private EmployeeController _employeeController;

    public AdvancedSearchController(EmployeeController employeeController)
    {
        _employeeController = employeeController;
    }

WhatWhen and how does the employeeControlleremployeeController in the code above get set? Or or passed into the constructor? How does this magic happen?

How does the construction injection work?

I have the following code:

public class AdvancedSearchController : Controller
{
    private EmployeeController _employeeController;

    public AdvancedSearchController(EmployeeController employeeController)
    {
        _employeeController = employeeController;
    }

What and how does the employeeController in the code above get set? Or passed into the constructor? How does this magic happen?

How does construction work with dependency injection?

With the following code:

public class AdvancedSearchController : Controller
{
    private EmployeeController _employeeController;

    public AdvancedSearchController(EmployeeController employeeController)
    {
        _employeeController = employeeController;
    }

When and how does the employeeController in the code above get set or passed into the constructor? How does this magic happen?

Question Protected by gnat
Source Link

How do constructor parameters of a MVC Controller get set?

How does the construction injection work?

I have the following code:

public class AdvancedSearchController : Controller
{
    private EmployeeController _employeeController;

    public AdvancedSearchController(EmployeeController employeeController)
    {
        _employeeController = employeeController;
    }

What and how does the employeeController in the code above get set? Or passed into the constructor? How does this magic happen?