From e4ba458f2429642cc4d8dcc1fb663cb7636b3c1e Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 7 Apr 2017 21:28:04 -0400 Subject: [PATCH] add discrimination number to blog id --- Project-Unite/Controllers/BlogController.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Project-Unite/Controllers/BlogController.cs b/Project-Unite/Controllers/BlogController.cs index 15591df..bc01229 100644 --- a/Project-Unite/Controllers/BlogController.cs +++ b/Project-Unite/Controllers/BlogController.cs @@ -160,6 +160,7 @@ public ActionResult PostBlog(PostBlogViewModel model) if (!allowed.Contains(c)) blog.Id = blog.Id.Replace(c, '_'); } + blog.Id += "_" + db.BlogPosts.Count().ToString(); blog.PostedAt = DateTime.Now; db.BlogPosts.Add(blog); db.SaveChanges();