Example #1
0
        public MySqlEventSource(MySqlConnectionString connectionString, EventDispatcher publisher)
        {
            var cfg = new Configuration()
                    .DataBaseIntegration(db =>
                    {
                        db.ConnectionString = (String)connectionString;
                        db.Dialect<MySQLDialect>();
                    });

            /* Add the mapping we defined: */
            var mapper = new ModelMapper();
            mapper.AddMapping(typeof(RecordedEventMap));
            HbmMapping mapping = mapper.CompileMappingForAllExplicitlyAddedEntities();
            cfg.AddMapping(mapping);

            this.factory = cfg.BuildSessionFactory();

            this._publisher = publisher;
            this._aggregateIdToStreamName = (t, g) => string.Format("{0}-{1}", char.ToLower(t.Name[0]) + t.Name.Substring(1), g);
        }
Example #2
0
        public MySqlEventSource(MySqlConnectionString connectionString, EventDispatcher publisher)
        {
            var cfg = new Configuration()
                      .DataBaseIntegration(db =>
            {
                db.ConnectionString = (String)connectionString;
                db.Dialect <MySQLDialect>();
            });

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

            mapper.AddMapping(typeof(RecordedEventMap));
            HbmMapping mapping = mapper.CompileMappingForAllExplicitlyAddedEntities();

            cfg.AddMapping(mapping);

            this.factory = cfg.BuildSessionFactory();

            this._publisher = publisher;
            this._aggregateIdToStreamName = (t, g) => string.Format("{0}-{1}", char.ToLower(t.Name[0]) + t.Name.Substring(1), g);
        }