예제 #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
                       ));
        }
예제 #2
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));
        }