public async Task <ViewResult> Details(int id, Comment comment) { var changes = _changesRepository.GetChanges(id); if (changes == null) { Response.StatusCode = 404; return(View("NotFound", id)); } if (ModelState.IsValid) { var user = await _userManager.GetUserAsync(User); comment.UserId = user.Id; comment.ChangesId = id; _commentRepository.Add(comment); } changes.Comments = _commentRepository.GetComments(id); var model = new ChangelogDetailsViewModel() { Changes = changes }; return(View(model)); }
public ViewResult Details(int id) { var changes = _changesRepository.GetChanges(id); if (changes == null) { Response.StatusCode = 404; return(View("NotFound", id)); } changes.Comments = _commentRepository.GetComments(id); var model = new ChangelogDetailsViewModel() { Changes = changes }; return(View(model)); }