private async Task <long> CreateScoringAsync( Project project, ScoringInfo scoringInfo) { var contractAddress = await _scoringsRegistryContractClient.GetScoringAddressAsync(project.ExternalId); var areaScorings = await _scoringsRegistryContractClient.GetRequiredExpertsCountsAsync(project.ExternalId); var offers = await CreateOffersAsync(scoringInfo.Offers); var scoring = new Scoring( project.Id, contractAddress, _clock.UtcNow, scoringInfo.AcceptingDeadline, scoringInfo.ScoringDeadline, areaScorings.Select(x => new AreaScoring { AreaId = x.Area, ExpertsCount = x.Count }).ToArray(), offers); _scoringRepository.Add(scoring); await _scoringRepository.SaveChangesAsync(); return(scoring.Id); }
public void Insert(Scoring entity) { _scoringRepository.Add(entity); }