roadie/Roadie.Api.Library/SearchEngines/MetaData/MetaDataProviderBase.cs

38 lines
1.1 KiB
C#
Raw Normal View History

2018-11-11 21:13:19 +00:00
using Microsoft.Extensions.Logging;
using Roadie.Library.Caching;
2018-11-04 20:33:37 +00:00
using Roadie.Library.Configuration;
2019-07-03 16:21:29 +00:00
using System.Net;
2018-11-03 21:21:36 +00:00
namespace Roadie.Library.MetaData
{
public abstract class MetaDataProviderBase
{
2019-07-03 16:21:29 +00:00
protected readonly ICacheManager _cacheManager;
protected readonly IRoadieSettings _configuration;
protected readonly ILogger _logger;
2018-11-03 21:21:36 +00:00
2019-06-02 04:27:17 +00:00
protected IApiKey _apiKey = null;
2018-11-04 20:33:37 +00:00
2019-07-03 16:21:29 +00:00
public virtual bool IsEnabled => true;
2018-11-03 21:21:36 +00:00
2019-07-03 16:21:29 +00:00
protected IApiKey ApiKey => _apiKey;
2018-11-04 20:33:37 +00:00
2019-07-03 16:21:29 +00:00
protected ICacheManager CacheManager => _cacheManager;
2018-11-03 21:21:36 +00:00
2019-07-03 16:21:29 +00:00
protected IRoadieSettings Configuration => _configuration;
2018-11-03 21:21:36 +00:00
2019-07-03 16:21:29 +00:00
protected ILogger Logger => _logger;
2018-11-03 21:21:36 +00:00
2018-11-11 21:13:19 +00:00
public MetaDataProviderBase(IRoadieSettings configuration, ICacheManager cacheManager, ILogger logger)
2018-11-03 21:21:36 +00:00
{
2019-07-03 16:21:29 +00:00
_configuration = configuration;
_cacheManager = cacheManager;
_logger = logger;
2018-11-03 21:21:36 +00:00
2019-07-03 16:21:29 +00:00
ServicePointManager.ServerCertificateValidationCallback += delegate
2018-11-03 21:21:36 +00:00
{
return true; // **** Always accept
};
}
}
}