Exemplo n.º 1
0
 private void ValidateConfig(SlooceConfig config)
 {
     if (string.IsNullOrEmpty(config.Url))
     {
         throw new ArgumentNullException(nameof(config.Url), "Cannot be null");
     }
     if (string.IsNullOrEmpty(config.Password))
     {
         throw new ArgumentNullException(nameof(config.Password), "Cannot be null");
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Creates an instance of the slooce api class. This class is thread safe(so share an instance).
 /// </summary>
 public SlooceApi(SlooceConfig config)
 {
     Config = config;
     ValidateConfig(Config);
     clientLazy = new Lazy <HttpClient>(InitClient);
 }