Exemple #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));
 }
        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));
        }
Exemple #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);
        }
Exemple #4
0
 public SerieService(ITmdbApi api)
 {
     _api = api;
 }
 public SerieService(ITmdbApi api, ISerieRepository serieRepository)
 {
     _api             = api;
     _serieRepository = serieRepository;
 }