Exemple #1
0
        static void Main()
        {
            var mappingContributors = new IMappingConfigurationContributor[]
            {
                new SutekiShopMappingConfiguration(),
                new StockControlMappingConfiguration()
            };

            var configurationBuilder = new FluentNHibernateConfigurationBuilder(mappingContributors);
            var configuration        = configurationBuilder.BuildConfiguration(
                MsSqlConfiguration.MsSql2005.ConnectionString(
                    c => c.FromConnectionStringWithKey("SutekiShopConnectionString")));

            var databaseManager = new DatabaseManager(configuration);

            if (databaseManager.DatabaseExists)
            {
                Console.WriteLine("Dropping Database {0}", databaseManager.GetDbName());
                databaseManager.DropDatabase();
            }
            Console.WriteLine("Creating Database {0}", databaseManager.GetDbName());
            databaseManager.CreateDatabase();

            Console.WriteLine("Inserting Static Data");
            new StaticDataGenerator(configuration).Insert();

            Console.WriteLine("Successfully Created Database {0}", databaseManager.GetDbName());
        }
Exemple #2
0
        static void Main()
        {
            var mappingContributors = new IMappingConfigurationContributor[]
            {
                new SutekiShopMappingConfiguration(),
                new StockControlMappingConfiguration()
            };

            var configurationBuilder = new FluentNHibernateConfigurationBuilder(mappingContributors);
            var configuration = configurationBuilder.BuildConfiguration(
                MsSqlConfiguration.MsSql2005.ConnectionString(
                    c => c.FromConnectionStringWithKey("SutekiShopConnectionString")));

            var databaseManager = new DatabaseManager(configuration);

            if (databaseManager.DatabaseExists)
            {
                Console.WriteLine("Dropping Database {0}", databaseManager.GetDbName());
                databaseManager.DropDatabase();
            }
            Console.WriteLine("Creating Database {0}", databaseManager.GetDbName());
            databaseManager.CreateDatabase();

            Console.WriteLine("Inserting Static Data");
            new StaticDataGenerator(configuration).Insert();

            Console.WriteLine("Successfully Created Database {0}", databaseManager.GetDbName());
        }
Exemple #3
0
 protected void SetMappingConfiguration(IMappingConfigurationContributor configurationContributor)
 {
     InMemoryDatabaseManager.SetMappingConfiguration(configurationContributor);
 }
Exemple #4
0
 public static void SetMappingConfiguration(IMappingConfigurationContributor contributor)
 {
     configurationContributor = contributor;
 }
 public static void SetMappingConfiguration(IMappingConfigurationContributor contributor)
 {
     configurationContributor = contributor;
 }
 protected void SetMappingConfiguration(IMappingConfigurationContributor configurationContributor)
 {
     InMemoryDatabaseManager.SetMappingConfiguration(configurationContributor);
 }
 public FluentNHibernateConfigurationBuilder(string connectionString, IMappingConfigurationContributor[] configurationContributors)
 {
     this.conectionStringKey = connectionString;
     this.configurationContributors = configurationContributors;
 }
 public FluentNHibernateConfigurationBuilder(IMappingConfigurationContributor[] configurationContributors)
 {
     this.configurationContributors = configurationContributors;
 }