Beispiel #1
0
        private static InsertSeiyuuHandler CreateHandler(SeiyuuMoeContext dbContext)
        {
            var scheduleConfiguration = ConfigurationReader.MalBgJobsScheduleConfiguration;

            var animeRepository     = new AnimeRepository(dbContext);
            var seiyuuRepository    = new SeiyuuRepository(dbContext);
            var characterRepository = new CharacterRepository(dbContext);
            var animeRoleRepository = new AnimeRoleRepository(dbContext);
            var seasonRepository    = new SeasonRepository(dbContext);

            var jikanUrl           = ConfigurationReader.JikanUrl;;
            var jikanConfiguration = new JikanClientConfiguration {
                Endpoint = jikanUrl, SuppressException = true
            };
            var jikanClient  = new Jikan(jikanConfiguration);
            var jikanService = new JikanService(jikanClient);

            var s3Client = new S3Service();

            return(new InsertSeiyuuHandler(
                       scheduleConfiguration.InsertSeiyuuBatchSize,
                       scheduleConfiguration.DelayBetweenCallsInSeconds,
                       seiyuuRepository,
                       seasonRepository,
                       characterRepository,
                       animeRepository,
                       animeRoleRepository,
                       jikanService,
                       s3Client
                       ));
        }
        private static UpdateCharacterHandler CreateHandler(SeiyuuMoeContext dbContext)
        {
            var characterRepository = new CharacterRepository(dbContext);

            var jikanUrl     = ConfigurationReader.JikanUrl;
            var jikanClient  = new Jikan(jikanUrl);
            var jikanService = new JikanService(jikanClient);

            return(new UpdateCharacterHandler(characterRepository, jikanService));
        }
        private UpdateSeasonsHandler CreateHandler(SeiyuuMoeContext dbContext)
        {
            var seasonRepository = new SeasonRepository(dbContext);

            var jikanUrl     = ConfigurationReader.JikanUrl;
            var jikanClient  = new Jikan(jikanUrl);
            var jikanService = new JikanService(jikanClient);

            return(new UpdateSeasonsHandler(seasonRepository, jikanService));
        }
Beispiel #4
0
        private static UpdateCharacterHandler CreateHandler(SeiyuuMoeContext dbContext)
        {
            var characterRepository = new CharacterRepository(dbContext);

            var jikanUrl           = ConfigurationReader.JikanUrl;;
            var jikanConfiguration = new JikanClientConfiguration {
                Endpoint = jikanUrl, SuppressException = true
            };
            var jikanClient  = new Jikan(jikanConfiguration);
            var jikanService = new JikanService(jikanClient);

            return(new UpdateCharacterHandler(characterRepository, jikanService));
        }
Beispiel #5
0
        private static UpdateSeiyuuHandler CreateHandler(SeiyuuMoeContext dbContext)
        {
            var animeRepository      = new AnimeRepository(dbContext);
            var seiyuuRepository     = new SeiyuuRepository(dbContext);
            var characterRepository  = new CharacterRepository(dbContext);
            var seiyuuRoleRepository = new SeiyuuRoleRepository(dbContext);
            var animeRoleRepository  = new AnimeRoleRepository(dbContext);
            var seasonRepository     = new SeasonRepository(dbContext);

            var jikanUrl     = ConfigurationReader.JikanUrl;
            var jikanClient  = new Jikan(jikanUrl, true);
            var jikanService = new JikanService(jikanClient);

            return(new UpdateSeiyuuHandler(seiyuuRepository, animeRepository, characterRepository, seiyuuRoleRepository, animeRoleRepository, seasonRepository, jikanService));
        }
        private InsertSeiyuuHandler CreateHandler(SeiyuuMoeContext dbContext, JikanService jikanService, IS3Service s3Service, int insertSeiyuuBatchSize)
        {
            var animeRepository     = new AnimeRepository(dbContext);
            var seiyuuRepository    = new SeiyuuRepository(dbContext);
            var characterRepository = new CharacterRepository(dbContext);
            var animeRoleRepository = new AnimeRoleRepository(dbContext);
            var seasonRepository    = new SeasonRepository(dbContext);

            return(new InsertSeiyuuHandler(
                       insertSeiyuuBatchSize,
                       0,
                       seiyuuRepository,
                       seasonRepository,
                       characterRepository,
                       animeRepository,
                       animeRoleRepository,
                       jikanService,
                       s3Service
                       ));
        }