Beispiel #1
0
        public static CommentDTO GetComment(int id)
        {
            using (var ctx = new DbEntities())
            {
                var ct = ctx.Comments
                         .Where(x => x.Id == id)
                         .FirstOrDefault();
                var comDTO = new CommentDTO
                {
                    UserId      = ct.UserId,
                    PostId      = ct.PostId,
                    CommentText = ct.CommentText,
                    Id          = ct.Id
                };

                return(comDTO);
            }
        }
        public bool InsertComment(CommentDTO comment)
        {
            CommentDAL cmtDAL = new CommentDAL();

            return(cmtDAL.InsertComment(comment));
        }
        public bool UpdateComment(CommentDTO comment)
        {
            CommentDAL cmtDAL = new CommentDAL();

            return(cmtDAL.UpdateComment(comment));
        }
Beispiel #4
0
 public void PostComment(CommentDTO postComment)
 {
     eventDal.PostComment(postComment);
 }