示例#1
0
 public TmdbAdapter(ITmdbApi tmdbApi,
                    TmdbAdapterConfiguration tmdbAdapterConfiguration,
                    ITypedCache typedCache)
 {
     this.tmdbApi = tmdbApi ?? throw new ArgumentNullException(nameof(tmdbApi));
     this.tmdbAdapterConfiguration = tmdbAdapterConfiguration ?? throw new ArgumentNullException(nameof(tmdbAdapterConfiguration));
     this.typedCache = typedCache ?? throw new ArgumentNullException(nameof(typedCache));
 }
示例#2
0
        public TmdbAdapter(ITmdbApi tmdbApi,
                           TmdbAdapterConfiguration tmdbAdapterConfiguration,
                           IMapper mapper)
        {
            this.tmdbApi = tmdbApi ??
                           throw new ArgumentNullException(nameof(tmdbApi));

            this.tmdbAdapterConfiguration = tmdbAdapterConfiguration ??
                                            throw new ArgumentNullException(nameof(tmdbAdapterConfiguration));


            this.mapper = mapper ?? throw new ArgumentNullException(nameof(mapper));
        }
示例#3
0
        public ITmdbApi GetInstance()
        {
            if (api == null)
            {
                var handler = new TmdbApiKeyHandler(AppSettings.TmdbApiKey);
                var client  = new HttpClient(handler)
                {
                    BaseAddress = new Uri(AppSettings.TmdbApiUrl)
                };
                api = RestService.For <ITmdbApi>(client);
            }

            return(api);
        }
示例#4
0
 public SerieService(ITmdbApi api)
 {
     _api = api;
 }
 public SerieService(ITmdbApi api, ISerieRepository serieRepository)
 {
     _api             = api;
     _serieRepository = serieRepository;
 }