Example #1
0
        public Z_Harag_Comment AddComment(CommentForPostModel model, int currentUserId)
        {
            if (currentUserId == 0)
            {
                return(null);
            }

            var entityModel = new Z_Harag_Comment
            {
                DateCreated = DateTime.Now,
                CommentedBy = currentUserId.ToString(),
                DateUpdated = DateTime.Now,
                CustomerId  = currentUserId,
                PostId      = model.PostId,
                Text        = model.Text
            };

            _commentRepository.Insert(entityModel);

            return(entityModel);
        }
 public static Z_Harag_Comment ToEntity(this CommentModel model, Z_Harag_Comment destination)
 {
     return(model.MapTo(destination));
 }
 public static CommentModel ToCommentModel(this Z_Harag_Comment entity)
 {
     return(entity.MapTo <Z_Harag_Comment, CommentModel>());
 }