Esempio n. 1
0
 /// <summary>
 /// Makes IsDayOff with overriden settings.
 /// </summary>
 /// <param name="settings">Settings</param>
 /// <exception cref="ArgumentNullException">Thrown when some not null property is set to null</exception>
 public IsDayOff(IsDayOffSettings settings)
     : this(
         settings,
         new IsDayOffApiClient(
             settings.ApiBaseUrl,
             settings.UserAgent,
             new HttpClientFactory(new HttpClientHandler())))
 {
 }
Esempio n. 2
0
        internal IsDayOff(IsDayOffSettings settings, IIsDayOffApiClient apiClient)
        {
            this.settings = settings ?? throw new ArgumentNullException(nameof(settings), ErrorsMessages.SettingCanNotBeNull());

            if (settings.TraceLevel.HasValue)
            {
                Tracer.Switch.Level = settings.TraceLevel.Value;
            }

            service = new IsDayOffService(apiClient, settings.Cache);
        }