using BankOfCeylon.BankOfCeylonAPIService; using BracBank.BracBankApiService; using Cebuana.ApiService; using Common.TPService; using Common.Utility; using Donga.DongaAPIService; using GMENepal.GMENepalAPIService; using log4net; using Transfast.ApiServices; using Unity; namespace Business.BusinessLogic.TPApiServices.Factory { public class ApiFactoryServices : IApiFactoryServices { private readonly ILog log = LogManager.GetLogger(typeof(ApiFactoryServices)); private readonly UnityContainer _container = new UnityContainer(); private ITPApiServices apiFactory; public ITPApiServices GetServices(string providerNo) { if (providerNo == GetStatic.ReadWebConfig("donga", "")) { log.Debug("Choose Provider as DongaAPI"); //apiFactory = _container.Resolve(); apiFactory = _container.Resolve(); } else if (providerNo == GetStatic.ReadWebConfig("transfast", "")) { log.Debug("Choose Provider as TFAPI"); apiFactory = _container.Resolve(); } else if (providerNo == GetStatic.ReadWebConfig("gmenepal", "")) { log.Debug("Choose Provider as GMENepalAPI"); apiFactory = _container.Resolve(); } else if (providerNo == GetStatic.ReadWebConfig("bankofceylon", "")) { log.Debug("Choose Provider as bankofceylon"); apiFactory = _container.Resolve(); } else if (providerNo == GetStatic.ReadWebConfig("Bracbank", "")) { log.Debug("Choose Provider as Brac Bank"); apiFactory = _container.Resolve(); } else if (providerNo == GetStatic.ReadWebConfig("Cebuana", "")) { log.Debug("Choose Provider as Cebuana "); apiFactory = _container.Resolve(); } return apiFactory; } } }