protected void Application_Start() { GlobalConfiguration.Configuration.DependencyResolver = new SimpleInjectorWebApiDependencyResolver(SimpleInjectorContainer.RegisterServices()); GlobalConfiguration.Configure(WebApiConfig.Register); }
protected void Application_Start() { SimpleInjectorContainer.RegisterServices(); //DependencyResolver.SetResolver( AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); DependencyResolver.SetResolver(SimpleInjectorContainer.RegisterServices()); }
protected void Application_Start() { GlobalConfiguration.Configure(WebApiConfig.Register); var container = SimpleInjectorContainer.RegisterServices(); container.RegisterWebApiControllers(GlobalConfiguration.Configuration); container.Verify(); GlobalConfiguration.Configuration.DependencyResolver = new SimpleInjectorWebApiDependencyResolver(container); AutoMapperConfig.RegisterMappings(); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); AutoMapperConfig.RegisterMappings(); SimpleInjectorContainer.RegisterServices(); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); Programmers.Data.RegisterMappings.Register(); SimpleInjectorContainer.RegisterServices(); }
protected void Application_Start() { var resolver = new SimpleInjectorWebApiDependencyResolver(SimpleInjectorContainer.RegisterServices()); GlobalConfiguration.Configuration.DependencyResolver = resolver; DependencyResolver.SetResolver(SimpleInjectorContainer.RegisterServices()); AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); }
protected void Application_Start() { Container container = SimpleInjectorContainer.RegisterServices(Assembly.GetExecutingAssembly()); DependencyResolver.SetResolver(new SimpleInjectorDependencyResolver(container)); AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); AutoMapperConfig.RegisterMappings(); }
public void Configuration(IAppBuilder app) { HttpConfiguration config = new HttpConfiguration(); config.DependencyResolver = new SimpleInjectorWebApiDependencyResolver(SimpleInjectorContainer.RegisterServices()); ConfigureOAuth(app); WebApiConfig.Register(config); app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll); app.UseWebApi(config); }
protected void Application_Start() { var container = SimpleInjectorContainer.RegisterServices(); container.RegisterMvcControllers(Assembly.GetExecutingAssembly()); container.RegisterMvcIntegratedFilterProvider(); container.Verify(); DependencyResolver.SetResolver(new SimpleInjectorDependencyResolver(container)); AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); }
protected void Application_Start() { var container = SimpleInjectorContainer.RegisterServices(new WebApiRequestLifestyle()); //container.Verify(); GlobalConfiguration.Configuration.DependencyResolver = new SimpleInjectorWebApiDependencyResolver(container); GlobalConfiguration.Configure(WebApiConfig.Register); AutoMapperConfig.RegisterMappings(); }
public void Configuration(IAppBuilder app) { var config = new HttpConfiguration { DependencyResolver = new SimpleInjectorWebApiDependencyResolver(SimpleInjectorContainer.RegisterServices()) }; Register(config); app.UseCors(CorsOptions.AllowAll); app.UseWebApi(config); }
protected void Application_Start(object sender, EventArgs e) { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); var container = SimpleInjectorContainer.RegisterServices(); DependencyResolver.SetResolver(new SimpleInjectorDependencyResolver(container)); ////auto Mapper AutoMapperConfig.RegisterMapping(); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); var container = SimpleInjectorContainer.RegisterServices(); container.RegisterWebApiControllers(GlobalConfiguration.Configuration); container.RegisterMvcIntegratedFilterProvider(); container.Verify(); GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); DependencyResolver.SetResolver(new SimpleInjectorDependencyResolver(container)); GlobalConfiguration.Configuration.DependencyResolver = new SimpleInjectorWebApiDependencyResolver(container); }
public static void Register(HttpConfiguration config) { // Web API configuration and services config.SuppressDefaultHostAuthentication(); config.Filters.Add(new HostAuthenticationFilter(OAuthDefaults.AuthenticationType)); // Web API routes config.MapHttpAttributeRoutes(); config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{action}/{id}", defaults: new { id = RouteParameter.Optional } ); config.DependencyResolver = new SimpleInjectorWebApiDependencyResolver(SimpleInjectorContainer.RegisterServices()); }
public static void Register(HttpConfiguration config) { // Serviços e configuração da API da Web // Rotas da API da Web config.MapHttpAttributeRoutes(); config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); DependencyResolver.SetResolver(new SimpleInjectorDependencyResolver( SimpleInjectorContainer.RegisterServices() )); }
public void Configuration(IAppBuilder appBuilder) { appBuilder.UseCors(CorsOptions.AllowAll); var config = new HttpConfiguration(); config.MapHttpAttributeRoutes(); config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); config.DependencyResolver = new SimpleInjectorWebApiDependencyResolver(SimpleInjectorContainer.RegisterServices()); appBuilder.UseWebApi(config); }
public void InsertNinjaWithoutClan() { //inicializa a injeção de dependencia SimpleInjectorContainer.RegisterServices(); INinjaRepository ninjaRepository = new NinjaRepository(); Ninja ninja = new Ninja { NinjaName = "Bolacha", DateCreated = DateTime.Now, DateModified = DateTime.Now }; if (!ninjaRepository.FindBy(n => n.NinjaName == ninja.NinjaName).Any()) { ninjaRepository.Add(ninja); ninjaRepository.Save(); } }
static void Main(string[] args) { //Resolvendo as dependências SimpleInjectorContainer.RegisterServices(); //Preparando o envento var idCliente = 10; var idObjeto = 574; var encomenda = new Encomenda(idCliente, idObjeto); var fazerUmaEncomenda = new EncomendaRealizada( encomenda.ClienteId, encomenda.ObjetoId, encomenda.DataEntregaPrevista ); //Realizando o evento DomainEvents.Raise(fazerUmaEncomenda); Console.ReadKey(); }
public void InserNinjaClan() { SimpleInjectorContainer.RegisterServices(); INinjaClanRepository ninjaClanRepository = new NinjaClanRepository(); NinjaClan ninjaClan = new NinjaClan { DateModified = DateTime.Now, DateCreated = DateTime.Now, ClanName = "Camargo's", FoundationDate = DateTime.Today }; if (!ninjaClanRepository.FindBy(clan => clan.ClanName == ninjaClan.ClanName).Any()) { ninjaClanRepository.Add(ninjaClan); ninjaClanRepository.Save(); } Console.WriteLine(ninjaClan.Id); }
protected void Application_Start() { DependencyResolver.SetResolver(SimpleInjectorContainer.RegisterServices()); AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); }
private static void InitializeContainer(Container container) { SimpleInjectorContainer.RegisterServices(container); }