Ejemplo n.º 1
0
        public static void Start()
        {
            var settings = new SparkSettings();
            settings.SetAutomaticEncoding(true);

            // Note: you can change the list of namespace and assembly
            // references in Views\Shared\_global.spark
            SparkEngineStarter.RegisterViewEngine(settings);
        }
        static void SetUpSparkViewEngine(IWindsorContainer container)
        {
            container.Register(Component.For<IBindingProvider>().ImplementedBy<DefaultBindingProvider>());

              var settings = new SparkSettings();
              settings.SetAutomaticEncoding(true);

              var services = SparkEngineStarter.CreateContainer(settings);
              services.SetService<IBindingProvider>(new CompositeBindingProvider(container));

              SparkEngineStarter.RegisterViewEngine(services);
        }
Ejemplo n.º 3
0
        public void ConfigureSpark()
        {
            var settings = new SparkSettings();
            settings.SetAutomaticEncoding(true);

            SparkEngineStarter.RegisterViewEngine(settings);

            container.Register(AllTypes.FromThisAssembly()
                 .Pick()
                 .If(t => typeof(ResourceController).IsAssignableFrom(t))
                 .Configure(c => c.LifeStyle.HybridPerWebRequestTransient())
                 .WithService.Self());
        }
        private static ISparkSettings GetSparkSettings(Assembly callingAssembly)
        {
            var sparkSettings = new SparkSettings();

            sparkSettings.AddAssembly(callingAssembly);

            #if DEBUG
            sparkSettings.SetDebug(true);
            #endif

            sparkSettings.SetAutomaticEncoding(false);
            sparkSettings.NullBehaviour = NullBehaviour.Strict;

            return sparkSettings;
        }
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterRoutes(RouteTable.Routes);

            ControllerBuilder.Current.SetControllerFactory(new PetaPocoControllerFactory());

            ObjectFactory.Initialize(x => x.AddRegistry<PetaPocoRegistry>());

            Database.Mapper = new MyMapper();

            var settings = new SparkSettings();
            settings.SetAutomaticEncoding(true);

            // Note: you can change the list of namespace and assembly
            // references in Views\Shared\_global.spark
            SparkEngineStarter.RegisterViewEngine(settings);

            InsertInitialData();
        }