protected void Application_Start() { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); MapperInit.Init(); }
public void Inicializar() { Mapper.Reset(); MapperInit.MapearDTOs(); mockRepositorioCliente = new Mock <IRepositorioCliente>(); mockRepositorioItem = new Mock <IRepositorioItem>(); mockRepositorioPedido = new Mock <IRepositorioPedido>(); mockServicoMensageria = new Mock <IServicoMensageria>(); mockLogger = new Mock <ILogger <LojaStoneFacade> >(); }
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { MapperInit.InitMapping(); app.UseExceptionless("riuCGjWnRDEXcvLASaeRHVdYE9OxHyFtb9SBXPvU"); app.UseMiddleware <ExceptionHandlerMiddleWare>(); app.UseCors(builder => builder .AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader()); app.UseMvc(); }
public static void RegisterDependencies() { var builder = new ContainerBuilder(); // IMapper builder.Register(c => MapperInit.Init()).AsSelf().SingleInstance(); builder.Register(c => c.Resolve <MapperConfiguration>().CreateMapper(c.Resolve)).As <IMapper>().InstancePerLifetimeScope(); var mapperConfig = new MapperConfiguration(m => { m.AddProfile(new Mappings.Profile.Profile()); }); builder.RegisterInstance(mapperConfig.CreateMapper()) .As <IMapper>() .SingleInstance(); // DbContext builder.RegisterType <VideoClubDbContext>().As <VideoClubDbContext>(); // Controllers builder.RegisterControllers(typeof(MvcApplication).Assembly); // ActionFilters // Services builder.RegisterType <OMDbAPIService>().As <IOMDbAPIService>().InstancePerRequest(); builder.RegisterType <PaginationService>().As <IPaginationService>().InstancePerRequest(); builder.RegisterType <LoggingService>().As <ILoggingService>().InstancePerRequest(); builder.RegisterType <MovieService>().As <IMovieService>().InstancePerRequest(); builder.RegisterType <RentingService>().As <IRentingService>().InstancePerRequest(); builder.RegisterType <CopyService>().As <ICopyService>().InstancePerRequest(); builder.RegisterType <UserService>().As <IUserService>().InstancePerRequest(); var container = builder.Build(); DependencyResolver.SetResolver(new AutofacDependencyResolver(container)); }
public Startup(IConfiguration configuration) { Configuration = configuration; AutoMapperConfiguration = MapperInit.MappInit(); }
public Startup(IConfiguration configuration) { Configuration = configuration; MapperInit.MapearDTOs(); }
protected void Application_Start() { MapperInit.InitMapping(); GlobalConfiguration.Configure(WebApiConfig.Register); }