private async ValueTask PublishPersisientEventAsync(UsageRecord usageRecord, UsageRecordsChangeEventKind eventKind) { if (_bus is not DumyBus) { await _bus.PubSub.PublishAsync <UsageRecordPersisientEventArgs>( new(usageRecord, eventKind)) .ContinueWith(task => { if (task.IsFaulted && task.Exception != null) { throw task.Exception; } }); } }
public UsageRecordPersisientEventArgs(UsageRecord usageRecord, UsageRecordsChangeEventKind eventKind) { EventKind = eventKind; UsageRecord = usageRecord; }