Ejemplo n.º 1
0
        internal static string ExportReadModelSchema(ReadModelConnectionString connectionString)
        {
            SchemaExport schema = new NHibernate.Tool.hbm2ddl.SchemaExport(buildConfig(connectionString));

            StringBuilder data = new StringBuilder();

            schema.Create((a) => { data.AppendLine(a); }, false);

            return(data.ToString());
        }
Ejemplo n.º 2
0
        internal static void CreateReadModelSchema(ReadModelConnectionString connectionString)
        {
            bool schemaCreated = false;

            if (!schemaCreated)
            {
                SchemaExport schema = new NHibernate.Tool.hbm2ddl.SchemaExport(buildConfig(connectionString));
                schema.Create(true, true);
                schemaCreated = true;
            }
        }
Ejemplo n.º 3
0
        private static Configuration buildConfig(ReadModelConnectionString connectionString)
        {
            var cfg = new Configuration().DataBaseIntegration(
                db =>
            {
                db.ConnectionString = (String)connectionString;
                db.Dialect <MySQLDialect>();
            });

            /* Add the mapping we defined: */
            var mapper = new ModelMapper();

            mapper.AddMappings(
                Assembly.GetExecutingAssembly()
                .GetTypes()
                .Where <Type>(g => g.FullName.EndsWith("Map") || g.IsSubclassOf(typeof(ClassMapping))));

            HbmMapping mapping = mapper.CompileMappingForAllExplicitlyAddedEntities();

            cfg.AddMapping(mapping);

            return(cfg);
        }
Ejemplo n.º 4
0
 protected ReadModel(ReadModelConnectionString connectionString)
 {
     _configuration = buildConfig(connectionString);
 }
Ejemplo n.º 5
0
 public Tasks(ReadModelConnectionString connectionString)
     : base(connectionString)
 {
 }
Ejemplo n.º 6
0
 public CollaborationRepo(ReadModelConnectionString connectionString)
     : base(connectionString)
 {
 }
Ejemplo n.º 7
0
 public Plans(ReadModelConnectionString connectionString)
     : base(connectionString)
 {
 }