/// <summary> /// 构造Dynamics365 WebAPI服务 /// </summary> public WebApiService() { _dynamics365Config = new Dynamics365Config(); if (_dynamics365Config.IsIfd) { var cacheManager = new RuntimeCacheManager(); _restClient = BuildOnIfd(cacheManager); } else { _restClient = BuildOnPremise(); } }
/// <summary> /// 构造Dynamics365 WebAPI服务 /// </summary> /// <param name="dynamics365Config">Dynamics365配置</param> /// <param name="cacheManager">缓存管理(on-premise时无须提供)</param> /// <exception cref="ArgumentNullException"></exception> public WebApiService(Dynamics365Config dynamics365Config, ICacheManager cacheManager) { if (dynamics365Config == null) { throw new ArgumentNullException(nameof(dynamics365Config)); } _dynamics365Config = dynamics365Config; if (_dynamics365Config.IsIfd) { if (cacheManager == null) { throw new ArgumentNullException(nameof(cacheManager)); } _restClient = BuildOnIfd(cacheManager); } else { _restClient = BuildOnPremise(); } }