示例#1
0
 public static CommentServiceModel mapCommentEntityToModel(Comment comment)
 {
     CommentServiceModel model = new CommentServiceModel();
     model.comment = comment.Comment1;
     model.id = comment.Id;
     return model;
 }
示例#2
0
 public static Comment unmapCommentEntityToModel(CommentServiceModel comment)
 {
     Comment model = new Comment();
     model.Comment1 = comment.comment;
     model.CreateDate = DateTime.Now;
     model.LastUpdatedDate = DateTime.Now;
     model.Id = comment.id;
     return model;
 }
示例#3
0
 public int insertComment(CommentServiceModel comment)
 {
     CommentsRepository repo = new CommentsRepository(entities);
     Comment model = DefectUtil.unmapCommentEntityToModel(comment);
     return repo.InsertComment(model);
 }