//demo transient, scoped public IActionResult DemoTransient() { ViewBag.Service1 = _services1.GetID(); ViewBag.Service2 = _services2.GetID(); ViewBag.Service3 = _services3.GetID(); ViewBag.Service4 = _services4.GetID(); ViewBag.Service5 = _services5.GetID(); return(View()); }
public IActionResult Index() { ViewBag.message1 = _transientSerivce1.GetID().ToString(); ViewBag.message2 = _transientSerivce2.GetID().ToString(); ViewBag.message3 = _scopedService1.GetID().ToString(); ViewBag.message4 = _scopedService2.GetID().ToString(); ViewBag.message5 = _singletonServie1.GetID().ToString(); ViewBag.message6 = _singletonServie2.GetID().ToString(); return(View()); }
public IActionResult DemoTransient() { ViewBag.Service1 = _sv1.GetID(); ViewBag.Service2 = _sv2.GetID(); ViewBag.Service3 = _sv3.GetID(); ViewBag.Service4 = _sv4.GetID(); ViewBag.Service5 = _sv5.GetID(); ViewBag.Service6 = _sv6.GetID(); return(View()); }
public IActionResult Index() { var model = new HomeViewModel() { TransientOne = transitentOne.GetID(), TransientTwo = transientTwo.GetID(), ScopedOne = scopedOne.GetID(), ScopedTwo = scopedTwo.GetID(), SingletonOne = singletonOne.GetID(), SingletonTwo = singletonTwo.GetID() }; return(View(model)); }
public IActionResult DemoTransient() { //var result = $"Service 1: {_service1.GetID()} - Service 2: {_service2.GetID()}"; //return Content(result); ViewBag.Service1 = _service1.GetID(); ViewBag.Service2 = _service2.GetID(); ViewBag.Service3 = _service3.GetID(); ViewBag.Service4 = _service4.GetID(); ViewBag.Service5 = _service5.GetID(); return(View()); }
public IActionResult Index() { var guid1 = _transientService1.GetID().ToString(); var guid2 = _transientService2.GetID().ToString(); var guid3 = _scopedService1.GetID().ToString(); var guid4 = _scopedService2.GetID().ToString(); var guid5 = _singletonService1.GetID().ToString(); var guid6 = _singletonService2.GetID().ToString(); return(Ok()); }
public IActionResult Index() { ViewBag.message1 = "First Instance " + _transientService1.GetID().ToString(); ViewBag.message2 = "Second Instance " + _transientService2.GetID().ToString(); ViewBag.message3 = "First Instance " + _scopedService1.GetID().ToString(); ViewBag.message4 = "Second Instance " + _scopedService2.GetID().ToString(); ViewBag.message6 = "First Instance " + _singletonService1.GetID().ToString(); ViewBag.message7 = "Second Instance " + _singletonService2.GetID().ToString(); return(View()); }