private static CreateReq.Types.StreamOptions StreamOptionsForCreateProto(string streamName, StreamPosition position)
        {
            if (position == StreamPosition.Start)
            {
                return(new CreateReq.Types.StreamOptions {
                    StreamIdentifier = streamName,
                    Start = new Empty()
                });
            }

            if (position == StreamPosition.End)
            {
                return(new CreateReq.Types.StreamOptions {
                    StreamIdentifier = streamName,
                    End = new Empty()
                });
            }

            return(new CreateReq.Types.StreamOptions {
                StreamIdentifier = streamName,
                Revision = position.ToUInt64()
            });
        }
Exemple #2
0
 public static StreamRevision FromStreamPosition(StreamPosition position) => position.ToUInt64() switch
 {