public async Task SaveEstimatesAsync(long expertId, SaveEstimatesRequest request) { var scoring = await _scoringRepository.GetByProjectIdAsync(request.ProjectId); var area = request.AreaType.ToDomain(); var estimates = request.EstimateComments.Select(x => new Estimate { Score = x.Score, ScoringCriterionId = x.ScoringCriterionId, Comment = x.Comment }).ToArray(); var expertScoring = new ExpertScoring { ExpertId = expertId, Area = area, Conclusion = request.Conclusion, Estimates = estimates }; scoring.SetExpertScoring(expertId, expertScoring); await _scoringRepository.SaveChangesAsync(); }
public async Task <IActionResult> PostAsync([FromBody] SaveEstimatesRequest request) { await _estimationService.SaveEstimatesAsync(User.GetUserId(), request); return(NoContent()); }