Beispiel #1
0
        public RedirectResult RedirectToTestimonial(string slug)
        {
            var testimonial = _testimonialService.Get(slug);

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

            return(Redirect(testimonial.Url));
        }
        public virtual RedirectResult RedirectTo(string slug)
        {
            var testimonial = _testimonialService.Get(slug);

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

            return(Redirect(testimonial.Url));
        }