public ScoreCombinationResultDto Post(ScoreCombinationRequestDto requestDto) { var request = _mapper.Map <ScoreCombinationRequest>(requestDto); var result = _serviceRecord.GetCombination(request); var resultDto = _mapper.Map <ScoreCombinationResultDto>(result); return(resultDto); }
public ActionResult <ScoreCombinationResultDto> Post([FromBody] ScoreCombinationRequestDto request) { if (request == null) { return(BadRequest("Please add some information to the request.")); } if (request.Sequence == null) { ModelState.AddModelError(nameof(request.Sequence), "Please add one or more scores to the sequence."); return(BadRequest(ModelState)); } if (request.Sequence.Any()) { return(Ok(_applicationServiceRecord.Post(request))); } return(BadRequest(ModelState)); }