public ActionResult OldSystemBlogPost(int id) { var blogPost = this.blogPosts.All().Select(x => new { x.Id, x.Title, x.CreatedOn, x.OldId }).FirstOrDefault(x => x.OldId == id); if (blogPost == null) { return(this.HttpNotFound("Blog post not found")); } IBlogUrlGenerator blogUrlGenerator = new BlogUrlGenerator(); var url = blogUrlGenerator.GenerateUrl(blogPost.Id, blogPost.Title, blogPost.CreatedOn); return(this.RedirectPermanent(url)); }
public PostAnnotationViewModel(BlogUrlGenerator blogUrlGenerator) { this.blogUrlGenerator = blogUrlGenerator; }