static bool EventSourceIsKey(ProjectEventKeySelectorType type, EventSourceId eventSource, out ProjectionKey key) { key = null; if (type != ProjectEventKeySelectorType.EventSourceId) { return(false); } key = eventSource.Value; return(true); }
static bool PartitionIsKey(ProjectEventKeySelectorType type, PartitionId partition, out ProjectionKey key) { key = null; if (type != ProjectEventKeySelectorType.PartitionId) { return(false); } key = partition.Value; return(true); }
static bool StaticIsKey(ProjectEventKeySelectorType type, ProjectionKey staticKey, out ProjectionKey key) { key = null; if (type != ProjectEventKeySelectorType.Static) { return(false); } key = staticKey; return(true); }
bool OccurredIsKey(ProjectEventKeySelectorType type, OccurredFormat occurredFormat, DateTimeOffset eventOccurred, out ProjectionKey key) { key = null; if (type != ProjectEventKeySelectorType.EventOccurred) { return(false); } try { key = eventOccurred.ToString(occurredFormat, CultureInfo.InvariantCulture); return(true); } catch (Exception ex) { Log.FailedToGetProjectionKeyFromOccurredKeySelector(_logger, ex, occurredFormat); key = null; return(false); } }
bool PropertyIsKey(ProjectEventKeySelectorType type, string eventContent, KeySelectorExpression keySelectorExpression, out ProjectionKey key) { key = null; return(type == ProjectEventKeySelectorType.Property && _keyPropertyExtractor.TryExtract(eventContent, keySelectorExpression, out key)); }