You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.4 KiB

  1. using Business.BusinessLogic.Auth;
  2. using Business.BusinessLogic.TPApiServices.Factory;
  3. using Business.BusinessLogic.TPApiServices.TPServices;
  4. using Business.TokenManagement;
  5. using Common.TPService;
  6. using GMENepal.GMENepalAPIService;
  7. using Repository.DAO.ThirdParty;
  8. using System.Web.Http;
  9. using Unity;
  10. using Unity.WebApi;
  11. namespace Business.DIConfig
  12. {
  13. public static class UnityConfig
  14. {
  15. public static void RegisterComponents()
  16. {
  17. var container = new UnityContainer();
  18. // e.g. container.RegisterType<ITestService, TestService>();
  19. //////
  20. #region Config for business Layer
  21. container.RegisterType<IAuthServices, AuthServices>();
  22. container.RegisterType<ITokenManagementServices, TokenManagementServices>();
  23. container.RegisterType<ITPApiServices, ThirdPartyServices>();
  24. container.RegisterType<IApiFactoryServices, ApiFactoryServices>();
  25. #endregion Config for business Layer
  26. #region Config for Repo Layer
  27. container.RegisterType<IThirdPartyRepo, ThirdPartyRepo>();
  28. #endregion Config for Repo Layer
  29. #region GMENEPAL
  30. container.RegisterType<ITPApiServices, GMENepalAPI>();
  31. #endregion GMENEPAL
  32. ////////
  33. GlobalConfiguration.Configuration.DependencyResolver = new UnityDependencyResolver(container);
  34. }
  35. }
  36. }