public RedirectResult RedirectToSocialNetwork(string slug) { var socialNetwork = _socialNetworkService.Get(slug); if (socialNetwork == null) { throw new HttpException((int)HttpStatusCode.NotFound, "SocialNetwork couldn't be not found."); } return(Redirect(socialNetwork.Url)); }
public virtual RedirectResult RedirectTo(string slug) { var socialNetwork = _socialNetworkService.Get(slug); if (socialNetwork == null || !socialNetwork.IsActive) { throw new HttpException((int)HttpStatusCode.NotFound, "SocialNetwork couldn't be found."); } return(Redirect(socialNetwork.Url)); }