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

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