internal static HttpClient Setup(this HttpClient extendee, ILarsSearchSettings settings) { extendee.DefaultRequestHeaders.Add("api-key", settings.ApiKey); extendee.DefaultRequestHeaders.Add("api-version", settings.ApiVersion); extendee.DefaultRequestHeaders.Add("indexes", settings.Indexes); return(extendee); }
public LarsSearchController( ILogger <LarsSearchController> logger, IOptions <LarsSearchSettings> larsSearchSettings, ILarsSearchService larsSearchService, ILarsSearchHelper larsSearchHelper, IPaginationHelper paginationHelper) { Throw.IfNull(logger, nameof(logger)); Throw.IfNull(larsSearchSettings, nameof(larsSearchSettings)); Throw.IfNull(larsSearchService, nameof(larsSearchService)); Throw.IfNull(larsSearchHelper, nameof(larsSearchHelper)); Throw.IfNull(paginationHelper, nameof(paginationHelper)); _logger = logger; _larsSearchSettings = larsSearchSettings.Value; _larsSearchService = larsSearchService; _larsSearchHelper = larsSearchHelper; _paginationHelper = paginationHelper; }
internal static Uri ToUri(this ILarsSearchSettings extendee) { return(new Uri($"{extendee.ApiUrl}?api-version={extendee.ApiVersion}")); }