public async Task Add(ReportCommentary commentary) { if (!ExecuteValidation(new ReportCommentaryValidation(), commentary)) { return; } commentary.CreationDate = DateTime.Now; commentary.Approved = true; await _repository.Add(commentary); }
public async Task <ActionResult> Add(ReportCommentaryInsertDto commentary) { ReportCommentary newCommentary = _mapper.Map <ReportCommentary>(commentary); await _service.Add(newCommentary); if (ValidOperation()) { var created = await _service.GetById(newCommentary.Id); return(CreatedAtAction(nameof(GetById), new { Id = newCommentary.Id, Version = "1.0" }, created)); } return(CustomResponse()); }
public Task Update(ReportCommentary commentary) { throw new NotImplementedException(); }