コード例 #1
0
        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)
                });
        }
コード例 #2
0
 public CommentViewModel(Comment comment)
 {
     _comment = comment;
 }
コード例 #3
0
 /// <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;
 }
コード例 #4
0
 public CommentViewModel()
 {
     _comment = new Comment { id = -1 };
 }
コード例 #5
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Comments EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToComments(Comment comment)
 {
     base.AddObject("Comments", comment);
 }