forked from kurrent-io/KurrentDB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEventReadResult.cs
44 lines (38 loc) · 1.38 KB
/
EventReadResult.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using EventStore.ClientAPI.Common.Utils;
using EventStore.ClientAPI.Messages;
namespace EventStore.ClientAPI
{
/// <summary>
/// A Event Read Result is the result of a single event read operation to the event store.
/// </summary>
public class EventReadResult
{
/// <summary>
/// The <see cref="EventReadStatus"/> representing the status of this read attempt
/// </summary>
public readonly EventReadStatus Status;
/// <summary>
/// The name of the stream read
/// </summary>
public readonly string Stream;
/// <summary>
/// The event number of the requested event.
/// </summary>
public readonly long EventNumber;
/// <summary>
/// The event read represented as <see cref="ResolvedEvent"/>
/// </summary>
public readonly ResolvedEvent? Event;
internal EventReadResult(EventReadStatus status,
string stream,
long eventNumber,
ClientMessage.ResolvedIndexedEvent @event)
{
Ensure.NotNullOrEmpty(stream, "stream");
Status = status;
Stream = stream;
EventNumber = eventNumber;
Event = status == EventReadStatus.Success ? new ResolvedEvent(@event) : (ResolvedEvent?)null;
}
}
}