Beispiel #1
0
        public IActionResult CoverImage(int id)
        {
            _imageRepository.ChangeCoverImage(id);
            var postId = _imageRepository.GetById(id).PostId;

            return(RedirectToAction("Edit", new { id = postId }));
        }
Beispiel #2
0
        public IActionResult CoverImage(int id)
        {
            _imageRepository.ChangeCoverImage(id);
            var    postId = _imageRepository.GetById(id).PostId;
            var    typeId = _imageRepository.GetById(id).Type;
            string type   = "";

            if (typeId == 1)
            {
                type = "Post";
            }
            else if (typeId == 2)
            {
                type = "Project";
            }

            return(RedirectToAction("Edit", type, new { id = postId }));
        }