Beispiel #1
0
        public void InitializeActiveRecord()
        {
            ActiveRecordPostgresConfig arPostgresConfig =
                new ActiveRecordPostgresConfig(activeRecordClassesAssemblyName: "PersonalAssistantWCF", showSql: false);

            arPostgresConfig.Initialize();
        }
        /// <summary>
        /// This method demonstrates how to initialize the ActiveRecord with PostgreSQL.
        /// </summary>
        private static void InitializeActiveRecord()
        {
            ActiveRecordPostgresConfig arPostgresConfig =
                new ActiveRecordPostgresConfig(activeRecordClassesAssemblyName: "CastleActiveRecord", showSql: false);

            arPostgresConfig.Initialize();
            //arPostgresConfig.DropSchema(); // Call this method to drop the database schema.
            //arPostgresConfig.CreateSchema(); // Call this method to create the database schema.

            // Call GenerateCreationScripts() method if you want to see the Creation Script:
            string directory = @"C:\Users\danilomeireles\Downloads\";
            string fileName  = directory + "script_" + DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss") + ".sql";

            arPostgresConfig.GenerateCreationScripts(fileName);
        }