Exemplo n.º 1
0
        public IActionResult DisplayBlog()
        {
            var bl    = DbConnection.DisplayBlog(Request.Cookies["userId"]).ToList();
            var blogs = MappingModels.MapListDatabaseBlog(bl);

            return(View(blogs));
        }
Exemplo n.º 2
0
        public IActionResult Index()
        {
            var blogs = MappingModels.MapListDatabaseBlog(DbConnection.DisplayAllBlogs());

            if (Request.Cookies.ContainsKey("userId"))
            {
                return(View(blogs));
            }
            return(RedirectToAction("Login", "Auth"));
        }