view comment author
This commit is contained in:
parent
4837af70c8
commit
841bd044d3
1 changed files with 9 additions and 6 deletions
|
|
@ -107,12 +107,12 @@ namespace Yavsc.Controllers
|
||||||
return HttpNotFound();
|
return HttpNotFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
BlogPost blog = _context.Blogspot.Include(
|
BlogPost blog = _context.Blogspot
|
||||||
b => b.Author
|
.Include(p => p.Author)
|
||||||
)
|
.Include(p => p.Tags)
|
||||||
.Include(p=>p.Tags)
|
.Include(p => p.Comments)
|
||||||
.Include(p=>p.Comments)
|
.Include(p => p.ACL)
|
||||||
.Include(p => p.ACL).Single(m => m.Id == id);
|
.Single(m => m.Id == id);
|
||||||
if (blog == null)
|
if (blog == null)
|
||||||
{
|
{
|
||||||
return HttpNotFound();
|
return HttpNotFound();
|
||||||
|
|
@ -121,6 +121,9 @@ namespace Yavsc.Controllers
|
||||||
{
|
{
|
||||||
return new ChallengeResult();
|
return new ChallengeResult();
|
||||||
}
|
}
|
||||||
|
foreach (var c in blog.Comments) {
|
||||||
|
c.Author = _context.Users.First(u=>u.Id==c.AuthorId);
|
||||||
|
}
|
||||||
ViewData["apicmtctlr"] = "/api/blogcomments";
|
ViewData["apicmtctlr"] = "/api/blogcomments";
|
||||||
ViewData["moderatoFlag"] = User.IsInRole(Constants.BlogModeratorGroupName);
|
ViewData["moderatoFlag"] = User.IsInRole(Constants.BlogModeratorGroupName);
|
||||||
return View(blog);
|
return View(blog);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue