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"); } }
/// <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); }