public async Task <IActionResult> CreateExpert([FromBody] ExpertInfoWriteDto expertInfo) { var createExpert = new CreateExpert(expertInfo.Nickname); var isCompletedSuccessfully = await _mediator.Send(createExpert); if (isCompletedSuccessfully) { return(Ok()); } else { return(new StatusCodeResult(StatusCodes.Status500InternalServerError)); } }
public async Task <IActionResult> DeleteExpert(int id, [FromBody] ExpertInfoWriteDto expertInfo) { var deleteExpert = new DeleteExpert(id); var isCompletedSuccessfully = await _mediator.Send(deleteExpert); if (isCompletedSuccessfully) { return(NoContent()); } else { return(new StatusCodeResult(StatusCodes.Status500InternalServerError)); } }
public async Task <IActionResult> UpdateExpert(int id, [FromBody] ExpertInfoWriteDto expertInfo) { var updateExpert = new UpdateExpertInfo(id, expertInfo.Nickname); var isCompletedSuccessfully = await _mediator.Send(updateExpert); if (isCompletedSuccessfully) { return(new StatusCodeResult(StatusCodes.Status201Created)); } else { return(new StatusCodeResult(StatusCodes.Status500InternalServerError)); } }