Пример #1
0
        /// <summary>
        /// Start a simple one-process engine using default providers.
        /// </summary>
        /// <param name="config">Engine configuration.</param>
        /// <param name="dbConnection">Database connection string.</param>
        /// <returns>Context for accessing the environment.</returns>
        public static IRFEnvironment StartLocal(string environment, RFEngineDefinition config, string dbConnection, IEnumerable <string> engineAssemblies)
        {
            LoadReferencedAssemblies();

            var le = new RFServiceEnvironment(environment, config, dbConnection);

            RFXMLSerializer.Initialize(engineAssemblies);
            RFRazor.Initialize(engineAssemblies);
            return(le);
        }
Пример #2
0
        /// <summary>
        /// Non-realtime context for Web processing.
        /// </summary>
        /// <param name="dbConnection">Database connection string.</param>
        /// <returns>Context for accessing the environment.</returns>
        public static IRFProcessingContext StartWeb(string environment, string dbConnection, IEnumerable <string> engineAssemblies)
        {
            LoadReferencedAssemblies();

            var se = new RFWebEnvironment(environment: environment, dbConnection: dbConnection);

            RFXMLSerializer.Initialize(engineAssemblies);
            RFRazor.Initialize(engineAssemblies);
            return(se.Start());
        }
Пример #3
0
        /// <summary>
        /// Environment for a single request, underneath an optional parent environment.
        /// </summary>
        /// <param name="dbConnection">Database connection string.</param>
        /// <returns>Context for accessing the environment.</returns>
        public static IRFEnvironment StartConsole(string environment, RFEngineDefinition config, string dbConnection, IEnumerable <string> engineAssemblies = null)
        {
            LoadReferencedAssemblies();

            var se = new RFConsoleEnvironment(
                environment: environment,
                config: config,
                dbConnection: dbConnection
                );

            RFXMLSerializer.Initialize(engineAssemblies);
            RFRazor.Initialize(engineAssemblies);
            return(se);
        }