Esempio 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());
        }
Esempio 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;
            }
        }
Esempio 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);
        }
Esempio n. 4
0
 protected ReadModel(ReadModelConnectionString connectionString)
 {
     _configuration = buildConfig(connectionString);
 }
Esempio n. 5
0
 public Tasks(ReadModelConnectionString connectionString)
     : base(connectionString)
 {
 }
Esempio n. 6
0
 public CollaborationRepo(ReadModelConnectionString connectionString)
     : base(connectionString)
 {
 }
Esempio n. 7
0
 public Plans(ReadModelConnectionString connectionString)
     : base(connectionString)
 {
 }