private async Task PublishAssetUpsertedEvent(Asset asset, string oldMdsCodeIfUpdated = null) { var evt = new AssetUpsertedEvent { Asset = asset, EventMetadata = new EventMetadata( eventId: Guid.NewGuid().ToString(), eventCreationDate: DateTime.UtcNow), PropertiesPriorValueIfUpdated = new AssetUpdatedProperties { UnderlyingMdsCode = oldMdsCodeIfUpdated } }; await _assetUpsertedPublisher.ProduceAsync(evt); _log.WriteInfo(nameof(LegacyAssetsCacheUpdater), evt, "Published asset upserted event"); }
public static bool MdsCodeChanged(this AssetUpsertedEvent src) { var value = src?.PropertiesPriorValueIfUpdated?.UnderlyingMdsCode; return(value != null); }