private static IUnityContainer ConfigureContainer() { var container = new UnityContainer(); var config = new MapperConfiguration(cfg => { cfg.AddProfile(new BllAutoMapperProfile()); cfg.AddProfile(new PLAutoMapperProfile()); }); container.BLLInitialize() .RegisterType <V1.ICommandService, V1.CommandService>() .RegisterType <V2.ICommandService, V2.CommandService>() .RegisterInstance <IMapper>(config.CreateMapper(), new HierarchicalLifetimeManager()) ; return(container); }