Esempio n. 1
0
        public IActionResult AddBlogPost(string title, string date, string content)
        {
            if (IsAdmin())
            {
                _context.AddBlogPost(title, Request.Cookies["user"], date, content);
                return(RedirectToAction("Private"));
            }

            TempData["error"] = "Your account does not have access to that resource";

            return(RedirectToAction("Index"));
        }