Ejemplo n.º 1
0
        public async Task<IActionResult> Index(int id = 0, string slug = "")
        {
            if (id == 0 || string.IsNullOrEmpty(slug))
            {
                return Redirect("/");
            }

            var data = new PostData(Db);
            var model = await data.GetByIdAsync(id);
            if (model == null) Redirect("/");            

            return View(model);
        }