|
|
@@ -22,6 +22,7 @@ namespace InvercargillSqlInversion {
|
|
|
|
|
|
// Register the connection
|
|
|
container.register<Connection>(() => ConnectionFactory.create_and_open(connection_string), effective_lifecycle);
|
|
|
+ print(@"Registered as $effective_lifecycle\n");
|
|
|
|
|
|
// Register the dialect provider
|
|
|
container.register_transient<SqlDialect>(() => DialectFactory.create_from_string(connection_string));
|
|
|
@@ -30,7 +31,7 @@ namespace InvercargillSqlInversion {
|
|
|
container.register_transient<MigrationRunner>(s => new MigrationRunner(s.resolve<Connection>(), s.resolve<SqlDialect>()));
|
|
|
|
|
|
// Register the type registry
|
|
|
- container.register_singleton<InversionTypeProvider>()
|
|
|
+ container.register_transient<InversionTypeProvider>()
|
|
|
.as<TypeProvider>();
|
|
|
|
|
|
// Register the orm session
|
|
|
@@ -51,7 +52,8 @@ namespace InvercargillSqlInversion {
|
|
|
configuration_func(builder);
|
|
|
var schema = dialect.introspect_schema(connection, builder.peek_table());
|
|
|
return builder.build_with_schema(schema);
|
|
|
- });
|
|
|
+ })
|
|
|
+ .with_metadata<MapperTypeInfo>(new MapperTypeInfo(typeof(T)));
|
|
|
}
|
|
|
|
|
|
public void add_projection<T>(owned ProjectionFactoryFunc<T> configuration_func) throws Error {
|
|
|
@@ -60,7 +62,8 @@ namespace InvercargillSqlInversion {
|
|
|
var builder = new ProjectionBuilder<T>(type_provider);
|
|
|
configuration_func(builder);
|
|
|
return builder.build();
|
|
|
- });
|
|
|
+ })
|
|
|
+ .with_metadata<MapperTypeInfo>(new MapperTypeInfo(typeof(T)));
|
|
|
}
|
|
|
|
|
|
public void migrate_on_startup() {
|