public void Setup() { _databaseFileName = Path.GetTempFileName(); _sessionFactory = DataUtility.CreateSessionFactory(_databaseFileName); _tempFolder = Path.GetTempFileName(); File.Delete(_tempFolder); var appDataFolder = AppDataFolderTests.CreateAppDataFolder(_tempFolder); var builder = new ContainerBuilder(); _session = _sessionFactory.OpenSession(); builder.RegisterInstance(appDataFolder).As <IAppDataFolder>(); builder.RegisterType <SqlCeDataServicesProvider>().As <IDataServicesProvider>(); builder.RegisterType <DataServicesProviderFactory>().As <IDataServicesProviderFactory>(); builder.RegisterType <StubReportsCoordinator>().As <IReportsCoordinator>(); builder.RegisterType <DefaultDataMigrationInterpreter>().As <IDataMigrationInterpreter>(); builder.RegisterType <SqlCeCommandInterpreter>().As <ICommandInterpreter>(); builder.RegisterType <SessionConfigurationCache>().As <ISessionConfigurationCache>(); builder.RegisterType <SessionFactoryHolder>().As <ISessionFactoryHolder>(); builder.RegisterType <DefaultDatabaseCacheConfiguration>().As <IDatabaseCacheConfiguration>(); builder.RegisterType <StubHostEnvironment>().As <IHostEnvironment>(); builder.RegisterInstance(new DefaultContentManagerTests.TestSessionLocator(_session)).As <ISessionLocator>(); builder.RegisterInstance(new ShellBlueprint { Records = Enumerable.Empty <RecordBlueprint>() }).As <ShellBlueprint>(); builder.RegisterInstance(new ShellSettings { Name = "temp", DataProvider = "SqlCe", DataTablePrefix = "TEST" }).As <ShellSettings>(); builder.RegisterModule(new DataModule()); _container = builder.Build(); _interpreter = _container.Resolve <IDataMigrationInterpreter>() as DefaultDataMigrationInterpreter; _schemaBuilder = new SchemaBuilder(_interpreter); }
public void Setup() { _databaseFileName = Path.GetTempFileName(); _sessionFactory = DataUtility.CreateSessionFactory(_databaseFileName); _tempFolder = Path.GetTempFileName(); File.Delete(_tempFolder); var appDataFolder = AppDataFolderTests.CreateAppDataFolder(_tempFolder); var builder = new ContainerBuilder(); _session = _sessionFactory.OpenSession(); builder.RegisterInstance(appDataFolder).As<IAppDataFolder>(); builder.RegisterType<SqlCeDataServicesProvider>().As<IDataServicesProvider>(); builder.RegisterType<DataServicesProviderFactory>().As<IDataServicesProviderFactory>(); builder.RegisterType<StubReportsCoordinator>().As<IReportsCoordinator>(); builder.RegisterType<DefaultDataMigrationInterpreter>().As<IDataMigrationInterpreter>(); builder.RegisterType<SqlCeCommandInterpreter>().As<ICommandInterpreter>(); builder.RegisterType<SessionConfigurationCache>().As<ISessionConfigurationCache>(); builder.RegisterType<SessionFactoryHolder>().As<ISessionFactoryHolder>(); builder.RegisterType<DefaultDatabaseCacheConfiguration>().As<IDatabaseCacheConfiguration>(); builder.RegisterType<StubHostEnvironment>().As<IHostEnvironment>(); builder.RegisterInstance(new TestTransactionManager(_session)).As<ITransactionManager>(); builder.RegisterInstance(new ShellBlueprint { Records = Enumerable.Empty<RecordBlueprint>() }).As<ShellBlueprint>(); builder.RegisterInstance(new ShellSettings { Name = "temp", DataProvider = "SqlCe", DataTablePrefix = "TEST" }).As<ShellSettings>(); builder.RegisterModule(new DataModule()); _container = builder.Build(); _interpreter = _container.Resolve<IDataMigrationInterpreter>() as DefaultDataMigrationInterpreter; _schemaBuilder = new SchemaBuilder(_interpreter); }
private SchemaBuilder CreateSchemaBuilder(ICustomSessionFactoryHolder sessionFactoryHolder, string featurePrefix = null, Func <string, string> formatPrefix = null) { ISessionLocator sessionLocator = new CustomSessionLocator(sessionFactoryHolder, false); var dataMigrationInterpreter = new DefaultDataMigrationInterpreter(_shellSettings, sessionLocator, new List <ICommandInterpreter>(), sessionFactoryHolder, _reportsCoordinator); return(new SchemaBuilder(dataMigrationInterpreter, featurePrefix, formatPrefix)); }
public SchemaUpdateService( IDynamicAssemblyBuilder dynamicAssemblyBuilder, ISessionFactoryHolder sessionFactoryHolder, ShellSettings shellSettings, ISessionLocator sessionLocator, IEnumerable<ICommandInterpreter> commandInterpreters, IReportsCoordinator reportsCoordinator) { _dynamicAssemblyBuilder = dynamicAssemblyBuilder; _sessionFactoryHolder = sessionFactoryHolder; var interpreter = new DefaultDataMigrationInterpreter(shellSettings, sessionLocator, commandInterpreters, sessionFactoryHolder, reportsCoordinator); _schemaBuilder = new SchemaBuilder(interpreter, "", s => s.Replace(".", "_")); }
public SchemaBuilder CreateSchemaBuilder(string name = null, string featurePrefix = null, Func<string, string> formatPrefix = null) { if (name == null) { var dataMigrationInterpreter = new DefaultDataMigrationInterpreter(_shellSettings, _sessionLocator, new List<ICommandInterpreter>(), _sessionFactoryHolder, _reportsCoordinator); return new SchemaBuilder(dataMigrationInterpreter, featurePrefix, formatPrefix); } else { var sessionFactoryHolder = _sessionFactoryHolderFactory.CreateSessionFactoryHolder(name); return CreateSchemaBuilder(sessionFactoryHolder, featurePrefix, formatPrefix); } }
public SchemaBuilder CreateSchemaBuilder(string name = null, string featurePrefix = null, Func <string, string> formatPrefix = null) { if (name == null) { var dataMigrationInterpreter = new DefaultDataMigrationInterpreter(_shellSettings, _sessionLocator, new List <ICommandInterpreter>(), _sessionFactoryHolder, _reportsCoordinator); return(new SchemaBuilder(dataMigrationInterpreter, featurePrefix, formatPrefix)); } else { var sessionFactoryHolder = _sessionFactoryHolderFactory.CreateSessionFactoryHolder(name); return(CreateSchemaBuilder(sessionFactoryHolder, featurePrefix, formatPrefix)); } }
private SchemaBuilder CreateSchemaBuilder(ICustomSessionFactoryHolder sessionFactoryHolder, string featurePrefix = null, Func<string, string> formatPrefix = null) { ISessionLocator sessionLocator = new CustomSessionLocator(sessionFactoryHolder, false); var dataMigrationInterpreter = new DefaultDataMigrationInterpreter(_shellSettings, sessionLocator, new List<ICommandInterpreter>(), sessionFactoryHolder, _reportsCoordinator); return new SchemaBuilder(dataMigrationInterpreter, featurePrefix, formatPrefix); }