Ejemplo n.º 1
0
 public bool IsValid(OccurredFormat format, out Exception error)
 {
     try
     {
         error = null;
         if (string.IsNullOrEmpty(format))
         {
             error = new OccurredFormatCannotBeNullOrEmpty();
             return(false);
         }
         _ = DateTimeOffset.UtcNow.ToString(format, CultureInfo.InvariantCulture);
         return(true);
     }
     catch (Exception ex)
     {
         error = ex;
         return(false);
     }
 }
Ejemplo n.º 2
0
 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);
     }
 }
Ejemplo n.º 3
0
 internal static partial void FailedToGetProjectionKeyFromOccurredKeySelector(ILogger logger, Exception exception, OccurredFormat occurredFormat);