コード例 #1
0
 public void Create(CommentDTO comment)
 {
     Comment com = new Comment
     {
         Text = comment.Text,
         CreationDate = DateTime.Now,
         ArticleId = comment.ArticleId,
         ProfileId = comment.ProfileId
     };
     Database.Comments.Create(com);
     Database.Save();
 }
コード例 #2
0
 public void Update(CommentDTO comment)
 {
     Mapper.CreateMap<CommentDTO, Comment>();
     Comment updateComment = Mapper.Map<CommentDTO, Comment>(comment);
     Database.Comments.Update(updateComment);
 }