Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
        public IViewComponentResult Invoke()
        {
            var date = _sqlAccess.ExecuteScalarQuery <DateTime>("select GetDate()");

            return(View("Default", date.ToLongDateString()));
        }