[ProducesResponseType(404)] // Not Found public async Task <ActionResult> Put(Guid studyId, [FromBody] Study study) { if (study == null || studyId == null || studyId == Guid.Empty) { return(NoContent()); } var commandResult = await _mediator.Send(new UpdateStudyCommand(study)); _studyService.UpdateStudy(study); return(Accepted(new Uri(String.Format(CultureInfo.InvariantCulture, "/api/studies/{0}", study.Id), UriKind.Relative), study)); }
public IActionResult UpdateStudy(int id, [FromBody] Study study) { var updateStudy = _studyService.GetStudy(id); if (updateStudy == null) { return(NotFound()); } if (study == null) { return(BadRequest()); } _studyService.UpdateStudy(id, study); return(Ok(study)); }
public Task <ActionResult <Study> > Handle(UpdateStudyCommand message, CancellationToken cancellationToken) { return(_studyService.UpdateStudy(message.Study)); }