using Common.TPService; using Common.Utility; using GMENepal.GMENepalAPIService; using log4net; using TPApiServices.GuavaPayRemit.Services; using TPApiServices.SendMNRemit.Services; using TPService.GCC.Services; 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("gmenepal", "")) { log.Debug("Choose Provider as GMENepalAPI"); apiFactory = _container.Resolve(); } else if (providerNo == GetStatic.ReadWebConfig("gccremit", "")) { log.Debug("Choose Provider as GCC "); apiFactory = _container.Resolve(); } else if (providerNo == GetStatic.ReadWebConfig("sendMN", "")) { log.Debug("Choose Provider as SENDMN "); apiFactory = _container.Resolve(); } else if (providerNo == GetStatic.ReadWebConfig("guavaPay", "")) { log.Debug("Choose Provider as guavaPay"); apiFactory = _container.Resolve(); } return apiFactory; } } }