public void MigrateMatchDetailsTest() { const int seriesId = 29750; const int htCountryId = 66; const int htFirstMatchId = 383708238; const int htSecondMatchId = 383708239; const short season = 31; const short matchRound = 12; var country = TestEntities.CreateCountry(htCountryId, "EnglishName", "countryName"); var series = TestEntities.CreateSeries(seriesId, country, "A Lyga"); var supportedIds = TestEntities.CreateSupportedIdList(); country.AddSeriesIdRange(supportedIds); var sessionFactory = SessionFactory.CreateSessionFactory(true); using (var session = sessionFactory.OpenSession()) { session.SaveOrUpdate(country); session.SaveOrUpdate(series); session.Flush(); } var service = new MigrateToNhibernateDomainService(SessionManager.CurrentSession); service.MigrateMatchDetails(htFirstMatchId, matchRound, season, seriesId); service.MigrateMatchDetails(htSecondMatchId, matchRound, season, seriesId); }
public async Task MigrateMatches(List<SeriesFixture> matches, int season, int leagueId, string operationId) { int matchesLeft = matches.Count; int totalMatches = matches.Count; var migrationService = new MigrateToNhibernateDomainService(_session); foreach (var match in matches) { migrationService.MigrateMatchDetails(match.HtMatchId, match.MatchRound, season, leagueId); matchesLeft--; _migrationStatus[operationId] = 100 - Convert.ToInt32(Math.Round(matchesLeft / (decimal)totalMatches * 100, 0)); } }
public ActionResult MigrateMatchDetails(int matchId, int matchRound, int season, int leagueId) { var migrationService = new MigrateToNhibernateDomainService(_session); migrationService.MigrateMatchDetails(matchId, matchRound, season, leagueId); return Json(true); }