public void DeleteCommentary(CommentaryDTO commentary) { try { service.DeleteCommentary(commentary); } catch { throw new Exception(); } }
public static CommentaryDTO ToModel(this Comment comment) { CommentaryDTO commentModel = new CommentaryDTO() { Id = comment.Id, CreationTimestamp = comment.CreationTimestamp, Text = comment.Text }; return(commentModel); }
public CommentaryDTO CreateCommentary(CommentaryDTO commentary) { try { return(service.CreateCommentary(commentary)); } catch { return(null); } }
public void DeleteCommentary(CommentaryDTO commentary) { try { Commentary comment = _mapper.Map <Commentary>(commentary); _lateDA.DeleteCommentary(comment); } catch { throw new Exception(); } }
public CommentaryDTO CreateCommentary(CommentaryDTO commentary) { try { Commentary comment = _mapper.Map <Commentary>(commentary); return(_mapper.Map <CommentaryDTO>(_lateDA.CreateCommentary(comment))); } catch { return(null); } }
public IActionResult addComment(int idTicket, IFormCollection inputs) { var idUser = User.Claims.Where(x => x.Type == "UserID").FirstOrDefault().Value; //Get UserID in Cookie CommentaryDTO newComment = new CommentaryDTO { idlate = idTicket, message = inputs["message"], iduser = Int32.Parse(idUser), date = new DateTime() }; late.CreateCommentary(newComment); return(RedirectToAction("Index")); }
public void Edit(CommentaryDTO commentary) { _fabric.CreateCommentsRepository().Update(commentary.ToEntity()); }
public void Delete(CommentaryDTO commentary) { _fabric.CreateCommentsRepository().Delete(commentary.ToEntity()); }
public static Comment ToEntity(this CommentaryDTO comment) { var config = new MapperConfiguration(cfg => cfg.CreateMap <CommentaryDTO, Comment>()); return(new Mapper(config).Map <CommentaryDTO, Comment>(comment)); }
public void DeleteCommentary(CommentaryDTO commentary) { ServiceLate service = new ServiceLate(); service.DeleteCommentary(commentary); }
public CommentaryDTO CreateCommentary(CommentaryDTO commentary) { ServiceLate service = new ServiceLate(); return(service.CreateCommentary(commentary)); }