Exemplo n.º 1
0
        public MsSqlServerEventStore(String connectionString, IEventTypeResolver typeResolver, IEventConverter converter)
        {
            if (String.IsNullOrEmpty(connectionString)) throw new ArgumentNullException("connectionString");

            _connectionString = connectionString;
            _converter = converter ?? new NullEventConverter();
            _formatter = new JsonEventFormatter(typeResolver ?? new SimpleEventTypeResolver());
            _translator = new StringEventTranslator();
        }
Exemplo n.º 2
0
        public MongoDBEventStore(string connectionString = DEFAULT_DATABASE_URI, IEventTypeResolver typeResolver = null, IEventConverter converter = null)
        {
            _database = MongoDatabase.Create(connectionString);
            _commits = _database.GetCollection<MongoCommit>("Commits");
            _events = _database.GetCollection<BsonDocument>("SourcedEvents");

            _converter = converter ?? new NullEventConverter();
            _formatter = new JsonEventFormatter(typeResolver ?? new SimpleEventTypeResolver());
            _translator = new StringEventTranslator();

            EnsureIndexes();
        }
Exemplo n.º 3
0
 public string ToString(IEventFormatter formatter)
 {
     return formatter.Format(this);
 }