예제 #1
0
 public CommentViewModel(Comment comment)
 {
     this.CommentId = comment.CommentId;
     this.UserName = comment.UserName;
     this.Created = comment.Created.ToLocalTime().ToUserFriendlyString();
     this.Message = comment.Message;
 }
예제 #2
0
 public CommentViewModel(Comment comment, Profile user)
     : this(comment)
 {
     this.UserName = user.DisplayName;
     this.UserAvatarSrc = Gravatar.GetUrl(user.GravatarEmail, 32) + "&d=identicon";
 }
예제 #3
0
 public ActionResult PostReviewComment(string reviewId, string message)
 {
     var comment = new Comment
     {
         Created = DateTime.UtcNow,
         UserName = this.User.Identity.Name,
         Message = message
     };
     this.repos.Reviews.AddReviewComment(reviewId, comment);
     return Json(new CommentViewModel(comment, this.repos.Profiles.Single(p => p.UserName == comment.UserName)));
 }