/// <summary>
 /// Internal constructor.
 /// </summary>
 internal BlobChangeFeedEvent(Dictionary <string, object> record)
 {
     Topic     = (string)record[Constants.ChangeFeed.Event.Topic];
     Subject   = (string)record[Constants.ChangeFeed.Event.Subject];
     EventType = new BlobChangeFeedEventType((string)record[Constants.ChangeFeed.Event.EventType]);
     EventTime = DateTimeOffset.Parse((string)record[Constants.ChangeFeed.Event.EventTime], CultureInfo.InvariantCulture);
     Id        = Guid.Parse((string)record[Constants.ChangeFeed.Event.EventId]);
     EventData = new BlobChangeFeedEventData((Dictionary <string, object>)record[Constants.ChangeFeed.Event.Data]);
     record.TryGetValue(Constants.ChangeFeed.Event.SchemaVersion, out object schemaVersion);
     SchemaVersion = (long)schemaVersion;
     record.TryGetValue(Constants.ChangeFeed.Event.MetadataVersion, out object metadataVersion);
     MetadataVersion = (string)metadataVersion;
 }
Beispiel #2
0
 /// <summary>
 /// Creates a new BlobChangeFeedEvent instance for mocking.
 /// </summary>
 public static BlobChangeFeedEvent BlobChangeFeedEvent(
     string topic,
     string subject,
     BlobChangeFeedEventType eventType,
     DateTimeOffset eventTime,
     Guid id,
     BlobChangeFeedEventData eventData,
     long dataVersion,
     string metadataVersion)
 => new BlobChangeFeedEvent
 {
     Topic           = topic,
     Subject         = subject,
     EventType       = eventType,
     EventTime       = eventTime,
     Id              = id,
     EventData       = eventData,
     SchemaVersion   = dataVersion,
     MetadataVersion = metadataVersion
 };