コード例 #1
0
        public Task CollectAsync(IUserNotification notification, string channel, ProcessStatus status)
        {
            Guard.NotNull(notification, nameof(notification));
            Guard.NotNullOrEmpty(channel, nameof(channel));

            var counterMap = CounterMap.ForChannel(channel, status);
            var counterKey = CounterKey.ForNotification(notification);

            return(StoreCountersAsync(counterKey, counterMap));
        }
コード例 #2
0
        public Task CollectAsync(IUserNotification notification, string channel, ProcessStatus status,
                                 CancellationToken ct = default)
        {
            Guard.NotNull(notification);
            Guard.NotNullOrEmpty(channel);

            var counterMap = CounterMap.ForChannel(channel, status);
            var counterKey = CounterKey.ForNotification(notification);

            return(StoreCountersAsync(counterKey, counterMap, ct));
        }
コード例 #3
0
        public Task InsertAsync(UserNotification notification, CancellationToken ct)
        {
            Guard.NotNull(notification, nameof(notification));

            var counterMap = CounterMap.ForNotification(ProcessStatus.Handled, 1);
            var counterKey = CounterKey.ForNotification(notification);

            return(Task.WhenAll(
                       StoreCountersAsync(counterKey, counterMap),
                       StoreInternalAsync(notification, ct)));
        }
コード例 #4
0
        public Task CollectAndUpdateAsync(IUserNotification notification, string channel, ProcessStatus status, string?detail)
        {
            Guard.NotNull(notification, nameof(notification));
            Guard.NotNullOrEmpty(channel, nameof(channel));

            var counterMap = CounterMap.ForChannel(channel, status);
            var counterKey = CounterKey.ForNotification(notification);

            return(Task.WhenAll(
                       StoreCountersAsync(counterKey, counterMap),
                       StoreInternalAsync(notification.Id, channel, status, detail)));
        }
コード例 #5
0
        public Task CollectAndUpdateAsync(IUserNotification notification, string channel, string configuration, ProcessStatus status, string?detail = null,
                                          CancellationToken ct = default)
        {
            Guard.NotNull(notification);
            Guard.NotNullOrEmpty(channel);

            var counterMap = CounterMap.ForChannel(channel, status);
            var counterKey = CounterKey.ForNotification(notification);

            return(Task.WhenAll(
                       StoreCountersAsync(counterKey, counterMap, ct),
                       StoreInternalAsync(notification.Id, channel, configuration, status, detail)));
        }