Open hung-doan opened 6 years ago
https://docs.microsoft.com/en-us/aspnet/core/mvc/controllers/dependency-injection?view=aspnetcore-2.1#action-injection-with-fromservices
public IActionResult About([FromServices] IDateTime dateTime) { ViewData["Message"] = "Currently on the server the time is " + dateTime.Now; return View(); }
https://docs.microsoft.com/en-us/aspnet/core/mvc/controllers/dependency-injection?view=aspnetcore-2.1#action-injection-with-fromservices