public static void Configurate() { var container = new ServiceContainer(); container.RegisterApiControllers(Assembly.GetExecutingAssembly()); container.EnablePerWebRequestScope(); var config = new MapperConfiguration(cfg => cfg.AddProfiles( new List <Profile>() { new WebAutomapperProfile(), new BLAutomapperProfile() })); container.Register(c => config.CreateMapper()); container = BLLightInjectConfiguration.Configuration(container); container.Register <IArticleService, ArticleService>(); container.Register <IAuthorService, AuthorService>(); container.Register <ICategoryService, CategoryService>(); container.Register <ITagService, TagService>(); container.EnableWebApi(GlobalConfiguration.Configuration); }
public static void Configurate() { var container = new ServiceContainer(); container.RegisterControllers(Assembly.GetExecutingAssembly()); container.EnablePerWebRequestScope(); //var config = new MapperConfiguration(cfg => cfg.AddProfiles( // new List<Profile>() { new WebAutomapperProfile(), new BLAutomapperProfile() })); /* container.Register(c => config.CreateMapper())*/ container = BLLightInjectConfiguration.Configuration(container); container.Register <IBookService, BookService>(); container.Register <IOrderService, OrderService>(); //container.Register<IAuthorService, AuthorService>(); //container.Register<IEmailService, EmailService>(); //container.Register<IArticleApiService, ArticleApiService>(); //var resolver = new LightInjectWebApiDependencyResolver(container); //DependencyResolver.SetResolver(new LightInjectMvcDependencyResolver(container)); container.EnableMvc(); }
public static void Congigurate() { var container = new ServiceContainer(); container.RegisterControllers(Assembly.GetExecutingAssembly()); //container.RegisterApiControllers(); //container.EnablePerWebRequestScope(); //container.EnableWebApi(GlobalConfiguration.Configuration); var config = new MapperConfiguration(cfg => cfg.AddProfiles( new List <Profile>() { new WebAutomapperProfile(), new BLAutomapperProfile() })); container.Register(c => config.CreateMapper()); container = BLLightInjectConfiguration.Configuration(container); container.Register <ITransactionService, TransactionService>(); container.Register <ICategoryService, CategoryService>(); //var resolver = new LightInjectWebApiDependencyResolver(container); DependencyResolver.SetResolver(new LightInjectMvcDependencyResolver(container)); container.EnableMvc(); }
public static void Configurate() { var container = new ServiceContainer(); container.RegisterControllers(Assembly.GetExecutingAssembly()); container.EnablePerWebRequestScope(); var config = new MapperConfiguration(cfg => cfg.AddProfiles( new List <Profile>() { new WebAutomapperProfile(), new BLAutomapperProfile() })); container.Register(c => config.CreateMapper()); container = BLLightInjectConfiguration.Configuration(container); container.Register <ICommentService, CommentService>(); container.Register <IPeriodicalService, PeriodicalService>(); container.Register <ITopicService, TopicService>(); container.EnableMvc(); }