Exemplo n.º 1
0
        public async Task <RequestResponseModel <InfoViewModel> > ImportInitialDataAsync()
        {
            _leagueRepository.Clear();

            var leagueIds = CalculateLeaguesIds(_configuration.InitialLeaguesAmount)
                            .ToList()
                            .GetEmptyIfNull();

            var leagues = await RetrieveLeaguesAsync(leagueIds);

            await SaveLeaguesAsync(leagues);
            await SetBetRatesForAllLeaguesAsync();

            return(new RequestResponseModel <InfoViewModel>(StatusCodes.Status200OK,
                                                            Enumerable.Empty <ErrorViewModel>(),
                                                            new InfoViewModel {
                Message = _localizer["SuccessfulImportMessage"].Value
            }));
        }