diff options
| author | Michael <[email protected]> | 2017-05-17 16:23:55 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-05-17 16:23:55 -0400 |
| commit | 588d21569c6a6adfcb9a75c29c57c43dc7954f06 (patch) | |
| tree | 75634d29d404e55372e9043a2dee3c2cf528a197 /Project-Unite/Views/Forum/ViewTopic.cshtml | |
| parent | 7bc8f60923470059ea0322c52cc05b0c6adae37e (diff) | |
| download | project-unite-588d21569c6a6adfcb9a75c29c57c43dc7954f06.tar.gz project-unite-588d21569c6a6adfcb9a75c29c57c43dc7954f06.tar.bz2 project-unite-588d21569c6a6adfcb9a75c29c57c43dc7954f06.zip | |
individual post subjects
Diffstat (limited to 'Project-Unite/Views/Forum/ViewTopic.cshtml')
| -rw-r--r-- | Project-Unite/Views/Forum/ViewTopic.cshtml | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Project-Unite/Views/Forum/ViewTopic.cshtml b/Project-Unite/Views/Forum/ViewTopic.cshtml index ed6b7c0..61ef682 100644 --- a/Project-Unite/Views/Forum/ViewTopic.cshtml +++ b/Project-Unite/Views/Forum/ViewTopic.cshtml @@ -3,6 +3,16 @@ @using Microsoft.AspNet.Identity @{ ViewBag.Title = Model.Subject; + var db = new Project_Unite.Models.ApplicationDbContext(); + var posts = db.ForumPosts.Where(x => x.Parent == Model.Id); + foreach(var post in posts.ToArray()) + { + if (string.IsNullOrWhiteSpace(post.Subject)) + { + post.Subject = Model.Subject; + } + } + db.SaveChanges(); } <ul class="nav nav-tabs"> |
