Persistence.Offset GetOffset(EventProcessorId id) { using (var es = _database.GetContext()) { return(es.Offsets.SingleOrDefault(_ => _.Id == id.ToString())); } }
/// <summary> /// /// </summary> /// <param name="eventProcessorId"></param> /// <param name="committedEventVersion"></param> /// <param name="partitionKey"></param> /// <returns></returns> public static Offset From(EventProcessorId eventProcessorId, CommittedEventVersion committedEventVersion, string partitionKey) { return(new Offset { Id = eventProcessorId.ToString(), Major = committedEventVersion.Major, Minor = committedEventVersion.Minor, Revision = committedEventVersion.Revision, PartitionKey = partitionKey }); }
Offset GetOffset(EventProcessorId id) { return(_config.Client.CreateDocumentQuery <Offset>(_config.OffsetsUri, GetFeedOptions()) .Where(_ => _.Id == id.ToString()).Take(1).AsEnumerable().SingleOrDefault()); }