public IActionResult OnGet(int id) { Id = id; ServerName = _sqlAccess.ExecuteScalarQuery <string>("select @@serverName"); if (id == 0) { return(RedirectToAction("Index", "Home", new { ComingFromPage = true })); } return(Page()); }
public IViewComponentResult Invoke() { var date = _sqlAccess.ExecuteScalarQuery <DateTime>("select GetDate()"); return(View("Default", date.ToLongDateString())); }