示例#1
0
        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");
        }
示例#2
0
        public static bool MdsCodeChanged(this AssetUpsertedEvent src)
        {
            var value = src?.PropertiesPriorValueIfUpdated?.UnderlyingMdsCode;

            return(value != null);
        }