Skip to content

eventstream class

Duncan Jones edited this page May 21, 2019 · 3 revisions

EventStream class

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.

Constructor

  public EventStream(EventStreamAttribute attribute, 
         string connectionStringName = "",
         IWriteContext context = null)

Methods

AppendEvent

public async Task AppendEvent(IEvent eventToAdd)

Appends the given event onto the event stream for the entity.

CreateIfNotExists

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

Exists

 public async Task<bool> Exists()

Does the event stream identified by the domain/type/instance exist yet?

SetContext

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)

Clone this wiki locally