Esempio n. 1
0
        // THis is From Servicess DI, AddTransient inject Object here
        public async Task <IActionResult> CallActionA([FromServices] IA A)
        {
            // Get Methods and Properties of Class without creating their objects
            ViewBag.DataA = await A.GetDataA();

            return(View());
        }
Esempio n. 2
0
        // This is normal calling in DI with Constructor
        public async Task <IActionResult> Index()
        {
            // Get Methods and Properties of Class without creating their objects
            ViewBag.DataA = await A.GetDataA();

            ViewBag.DataB = await B.GetDataB();

            ViewBag.DataC = await C.GetDataC();

            return(View());
        }