public IActionResult Index([FromServices] TesteC testeC) { ViewBag.ObjetoA = _testeA; ViewBag.ObjetoB = _testeB; ViewBag.ObjetoC = testeC; return(View()); }
public ValuesController( ITesteA testeA, ITesteB testeB, TesteC testeC) { _testeA = testeA; _testeB = testeB; _testeC = testeC; }
public Teste(TesteInjecao objTesteInjecao, ITesteA testeA, ITesteB testeB, TesteC testeC) { _objTesteInjecao = objTesteInjecao; _testeA = testeA; _testeB = testeB; _testeC = testeC; }
public ActionResult <object> Get( [FromServices] ITesteA testeA, [FromServices] ITesteB testeB, [FromServices] TesteC testeC) { var valoresA = new { Construtor = _testeA.IdReferencia, Action = testeA.IdReferencia }; var valoresB = new { Construtor = _testeB.IdReferencia, Action = testeB.IdReferencia }; var valoresC = new { Construtor = _testeC.IdReferencia, Action = testeC.IdReferencia }; return(new { valoresA, valoresB, valoresC }); }