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(); }
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(); }
public string ToString(IEventFormatter formatter) { return formatter.Format(this); }