protected WebApiHttpClient GetWebAPIClient(TenantModel tenant) { WebApiHttpClient webApiHttpClient = new WebApiHttpClient(tenant.WebApiClientConfig, tenant.OriginalConfiguration, (s) => FileLogger.Debug(LogName.WebAPIClientLog, s), _customAuthFunc); webApiHttpClient.SetEntityODATA <T>(); return(webApiHttpClient); }
public async Task <UDSRepository> GetCurrentUDSRepositoryAsync(string udsRepositoryName) { return(await ExecuteHelper(async() => { _httpClient.SetEntityODATA <UDSRepository>(); ODataModel <UDSRepository> currentRepository = (await _httpClient.GetAsync <UDSRepository>() .WithOData(string.Concat("$filter=Name eq \'", udsRepositoryName, "\' and ExpiredDate eq null and Status eq VecompSoftware.DocSuiteWeb.Entity.UDS.UDSRepositoryStatus\'", DocSuiteWeb.Entity.UDS.UDSRepositoryStatus.Confirmed, "\'&$orderby=version desc")) .ResponseToModelAsync <ODataModel <UDSRepository> >()); return currentRepository == null || currentRepository.Value == null || !currentRepository.Value.Any() ? null : currentRepository.Value.Single(); }, $"WebAPIClient.GetCurrentUDSRepositoryAsync -> GET entities error")); }