public static void RegisterComponents()
        {
            //var container = new UnityContainer();

            //         // register all your components with the container here
            //         // it is NOT necessary to register your controllers

            //         // e.g. container.RegisterType<ITestService, TestService>();
            //         //RegisterAutoMapperProfiles(container);

            DiContainerProvider.BuildUnityContainer(GetAssembliesToScan(), ManualRegistrations, FactoryRegistrations);
            AutoMapperHelper.RegisterAutoMapperProfiles(Container, new List <Assembly>
            {
                typeof(UserManager).Assembly
            });
            GlobalConfiguration.Configuration.DependencyResolver = new UnityDependencyResolver(Container);
        }
 public static IMapper SetupAutoMapper()
 {
     DiContainerProvider.BuildUnityContainer(GetAssembliesToScan(), ManualRegistrations, FactoryRegistrations);
     AutoMapperHelper.RegisterAutoMapperProfiles(DiContainerProvider.Container, GetAssembliesToScan());
     return(DiContainerProvider.Container.Resolve <IMapper>());
 }