public async Task <ActionResult <CreatedTestResultDto> > Post([FromBody] NewTestResultDto newTestResultDto) { if (newTestResultDto == null) { return(BadRequest()); } return(Ok(await testResultService.CreateTestResult(newTestResultDto))); }
public async Task <CreatedTestResultDto> CreateTestResult(NewTestResultDto newTestResultDto) { TestResult testResult = mapper.Map <TestResult>(newTestResultDto); testResultRepository.Insert(testResult); await unitOfWork.SaveAsync(); return(mapper.Map <CreatedTestResultDto>(testResult)); }