ICEMortgageTechnology / developerconnect-dotnet-bindings

43 stars 27 forks source link

ApiClientProvider Default Value on ApiHost #5

Open bchingAFI opened 6 years ago

bchingAFI commented 6 years ago

Hi,

I am working with dot Net Core and configuration file is no longer exist.

I think the purpose of the following code is to set the default value of ApiHost if Config is null.

Existing code: if (Config != null) { var apiBasePath = Config != null && string.IsNullOrEmpty(Config.ApiHost) ? "https://api.elliemae.com" : Config.ApiHost; object[] parameters = { apiBasePath }; var retVal = (T)Activator.CreateInstance(typeof(T), parameters); return retVal; }

New Code: var apiBasePath = (!string.IsNullOrEmpty(Config?.ApiHost) ? Config.ApiHost : "https://api.elliemae.com"); object[] parameters = { apiBasePath }; var retVal = (T)Activator.CreateInstance(typeof(T), parameters); return retVal;