Beispiel #1
0
        public FlickrService(IPhotoProcessor photoProcessor, IUiController ui, FlickrConfig config)
        {
            _ui             = ui;
            _config         = config;
            _photoProcessor = photoProcessor;
            _flickr         = new Flickr(_config.ApiKey, _config.ApiSecret);

            this.Authenticate();
        }
Beispiel #2
0
        public void ConfigureServices(IServiceCollection services)
        {
            services.Configure <FrontConfig>(_configuration.GetSection("frontConfig"));

            var vkConfig = new VkConfig();

            _configuration.GetSection("vkConfig").Bind(vkConfig);
            services.AddSingleton <IVkService, VkService>(x => new VkService(vkConfig));

            var flickrConfig = new FlickrConfig();

            _configuration.GetSection("flickrConfig").Bind(flickrConfig);
            services.AddSingleton <IFlickrService, FlickrService>(x => new FlickrService(flickrConfig));

            services.AddSingleton <IDataService, DataService>();

            services.AddMvc()
            .AddJsonOptions(x => x.UseCamelCasing(true));
        }
Beispiel #3
0
 public FlickrService(FlickrConfig config) : base(config)
 {
     _apiKey = config.ApiKey;
 }