Example #1
0
        public IActionResult Index([FromServices] TesteC testeC)
        {
            ViewBag.ObjetoA = _testeA;
            ViewBag.ObjetoB = _testeB;
            ViewBag.ObjetoC = testeC;

            return(View());
        }
Example #2
0
 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;
 }
Example #4
0
        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 });
        }