Пример #1
0
        public RedirectResult RedirectToFriendLink(string slug)
        {
            var friendLink = _friendLinkService.Get(slug);

            if (friendLink == null)
            {
                throw new HttpException((int)HttpStatusCode.NotFound, "FriendLink couldn't be not found.");
            }

            return(Redirect(friendLink.Url));
        }
Пример #2
0
        public virtual RedirectResult RedirectTo(string slug)
        {
            var friendLink = _friendLinkService.Get(slug);

            if (friendLink == null || !friendLink.IsActive)
            {
                throw new HttpException((int)HttpStatusCode.NotFound,
                                        "FriendLink couldn't be found.");
            }

            return(Redirect(friendLink.Url));
        }