-
Notifications
You must be signed in to change notification settings - Fork 20
eventstream class
Duncan Jones edited this page May 21, 2019
·
3 revisions
The EventStream
class allows you to append events onto a specific event stream for an entity as uniquely identified by the combination of the domain, the entity type and the unique identifier of the entity.
public EventStream(EventStreamAttribute attribute,
string connectionStringName = "",
IWriteContext context = null)
public async Task AppendEvent(IEvent eventToAdd)
Appends the given event onto the event stream for the entity.
public async Task CreateIfNotExists()
Explicitly create the event stream if it does not already exist.
Note that appending an event to an event stream that doesn't yet exist will create a new event stream
public async Task<bool> Exists()
Does the event stream identified by the domain/type/instance exist yet?
public void SetContext(IWriteContext context)
Set the writer context which is used to "wrap" events written so we know who wrote them (and when and why)