internal IsDayOffSettings(string apiBaseUrl, string userAgent, IIsDayOffCache cache, Country defaultCountry, bool useShortDays, bool treatNonWorkingDaysByCovidAsWorkingDayAdvanced, bool useSixDaysWorkWeek, SourceLevels?traceLevel) { ApiBaseUrl = apiBaseUrl; UserAgent = userAgent; Cache = cache; DefaultCountry = defaultCountry; UseShortDays = useShortDays; TreatNonWorkingDaysByCovidAsWorkingDayAdvanced = treatNonWorkingDaysByCovidAsWorkingDayAdvanced; UseSixDaysWorkWeek = useSixDaysWorkWeek; TraceLevel = traceLevel; }
/// <summary> /// Set up custom cache implementation /// </summary> /// <param name="newCache">Custom cache implementation</param> /// <exception cref="ArgumentNullException">Thrown when customCache is set to null</exception> /// <returns>Settings builder</returns> public IsDayOffSettingsBuilder UseCustomCache(IIsDayOffCache newCache) { cache = newCache ?? throw new ArgumentNullException(nameof(cache), ErrorsMessages.CacheCanNotBeNull()); return(this); }
/// <summary> /// Set up to use built-in in-memory cache /// </summary> /// <returns>Settings builder</returns> public IsDayOffSettingsBuilder UseInMemoryCache() { cache = new IsDayOffInMemoryCache(); return(this); }
public IsDayOffService(IIsDayOffApiClient apiClient, IIsDayOffCache cache) { this.apiClient = apiClient; this.cache = cache; }