Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
        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));
            }            
        }
Exemplo n.º 3
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);
        }