コード例 #1
0
ファイル: ProjectionKeys.cs プロジェクト: dolittle/Runtime
 static bool EventSourceIsKey(ProjectEventKeySelectorType type, EventSourceId eventSource, out ProjectionKey key)
 {
     key = null;
     if (type != ProjectEventKeySelectorType.EventSourceId)
     {
         return(false);
     }
     key = eventSource.Value;
     return(true);
 }
コード例 #2
0
ファイル: ProjectionKeys.cs プロジェクト: dolittle/Runtime
 static bool PartitionIsKey(ProjectEventKeySelectorType type, PartitionId partition, out ProjectionKey key)
 {
     key = null;
     if (type != ProjectEventKeySelectorType.PartitionId)
     {
         return(false);
     }
     key = partition.Value;
     return(true);
 }
コード例 #3
0
ファイル: ProjectionKeys.cs プロジェクト: dolittle/Runtime
 static bool StaticIsKey(ProjectEventKeySelectorType type, ProjectionKey staticKey, out ProjectionKey key)
 {
     key = null;
     if (type != ProjectEventKeySelectorType.Static)
     {
         return(false);
     }
     key = staticKey;
     return(true);
 }
コード例 #4
0
ファイル: ProjectionKeys.cs プロジェクト: dolittle/Runtime
 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);
     }
 }
コード例 #5
0
ファイル: ProjectionKeys.cs プロジェクト: dolittle/Runtime
 bool PropertyIsKey(ProjectEventKeySelectorType type, string eventContent, KeySelectorExpression keySelectorExpression, out ProjectionKey key)
 {
     key = null;
     return(type == ProjectEventKeySelectorType.Property && _keyPropertyExtractor.TryExtract(eventContent, keySelectorExpression, out key));
 }