add discrimination number to blog id

This commit is contained in:
Michael 2017-04-07 21:28:04 -04:00
parent f6f3c628e0
commit e4ba458f24

View file

@ -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();