Ejemplo n.º 1
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            // Configure AutoFac
            AutofacWebapiConfig.Initialize(GlobalConfiguration.Configuration);

            // Configure Automapper
            AutomapperConfig.ConfigureMappings();
        }
Ejemplo n.º 2
0
 public IContainer BootstrapApplication(IContainer container)
 {
     container.Configure(cfg =>
     {
         cfg.AddRegistry <DominionRegistry>();
         cfg.Scan(scan =>
         {
             scan.AssemblyContainingType <Game>();
             scan.Assembly("Dominion.Cards.BasicSet");
             scan.AssemblyContainingType <AiRegistry>();
             scan.LookForRegistries();
             scan.AssemblyContainingType <Game>();
             scan.WithDefaultConventions();
             scan.Convention <DefaultCtorParameterConvention>();
         });
     });
     AutomapperConfig.ConfigureMappings(container);
     return(container);
 }
Ejemplo n.º 3
0
 public void Automapper_configuration_should_be_valid()
 {
     AutomapperConfig.ConfigureMappings(new AiBootstrapper().BootstrapContainer());
     Mapper.AssertConfigurationIsValid();
 }