public ActionResult Details(int id, Comment comment) { _commentRepository.AddComment(comment); _hairStyleRepository.RegisterHairStyleComment(id, comment); var hairStyle = _hairStyleRepository.GetById(id); var comments = _hairStyleRepository.GetHairStyleComments(id); return View(new HairStyleViewModel(hairStyle) { Comments = comments, BigImages = _hairStyleRepository.GetHairStyleImages(id) }); }
public CommentViewModel(Comment comment) { _comment = comment; }
/// <summary> /// Create a new Comment object. /// </summary> /// <param name="id">Initial value of the id property.</param> /// <param name="author">Initial value of the author property.</param> /// <param name="date">Initial value of the date property.</param> /// <param name="message">Initial value of the message property.</param> public static Comment CreateComment(global::System.Int32 id, global::System.String author, global::System.DateTime date, global::System.String message) { Comment comment = new Comment(); comment.id = id; comment.author = author; comment.date = date; comment.message = message; return comment; }
public CommentViewModel() { _comment = new Comment { id = -1 }; }
/// <summary> /// Deprecated Method for adding a new object to the Comments EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToComments(Comment comment) { base.AddObject("Comments", comment); }