public abstract Task Handle(IAsyncNotification message);
Esempio n. 2
0
 public AppToastNotification(IAsyncNotification notification)
 {
     Notification = notification;
 }
Esempio n. 3
0
 public static Task PublishDomainEvent(IAsyncNotification evt) => _cheat.Mediator.PublishAsync(evt);
Esempio n. 4
0
 private IEnumerable <AsyncNotificationHandlerWrapper> GetNotificationHandlers(IAsyncNotification notification)
 {
     return(GetNotificationHandlers <AsyncNotificationHandlerWrapper>(notification,
                                                                      typeof(IAsyncNotificationHandler <>),
                                                                      typeof(AsyncNotificationHandlerWrapper <>)));
 }
Esempio n. 5
0
 public void AddDomainEvent(IAsyncNotification eventItem)
 {
     _domainEvents = _domainEvents ?? new List <IAsyncNotification>();
     _domainEvents.Add(eventItem);
 }
Esempio n. 6
0
 public virtual Task PublishAsync(IAsyncNotification notification)
 {
     return(_mediator.PublishAsync(notification));
 }
        /// <summary>
        /// Provides the asynchronous observer with new data.
        /// </summary>
        /// <typeparam name="TValue">The object that provides notification information.</typeparam>
        /// <typeparam name="TResult">The type of the asynchronous result.</typeparam>
        /// <param name="observer">An asynchronous observer.</param>
        /// <param name="value">The current asynchronous notification information.</param>
        /// <returns>A <see cref="Task"/> that is signaled when the asynchronous observation completes.</returns>
        public static Task <TResult> OnNextAsync <TValue, TResult>(this IObserver <IAsyncNotification <TValue, TResult> > observer, IAsyncNotification <TValue, TResult> value)
        {
            Contract.Requires(observer != null);
            Contract.Requires(value != null);
            Contract.Ensures(Contract.Result <Task <TResult> >() != null);

            observer.OnNext(value);

            return(value.Task);
        }
        /// <summary>
        /// Projects the specified <paramref name="notification"/> into a new notification containing the value returned by the specified <paramref name="selector"/> function
        /// and linked to the state of the specified <paramref name="notification"/>.
        /// </summary>
        /// <typeparam name="TValue">The type of the old notification information.</typeparam>
        /// <typeparam name="TTaskResult">The type of the asynchronous result of the old and new notifications.</typeparam>
        /// <typeparam name="TResult">The type of the new notification information.</typeparam>
        /// <param name="notification">The notification from which to project a new notification.</param>
        /// <param name="selector">A function that projects the specified <paramref name="notification"/> into a new notification.</param>
        /// <returns>A new <see cref="IAsyncNotification{TResult,TTaskResult}"/> containing the value returned by the specified <paramref name="selector"/> function.</returns>
        public static IAsyncNotification <TResult, TTaskResult> Select <TValue, TTaskResult, TResult>(this IAsyncNotification <TValue, TTaskResult> notification, Func <TValue, TResult> selector)
        {
            Contract.Requires(notification != null);
            Contract.Requires(selector != null);
            Contract.Ensures(Contract.Result <IAsyncNotification <TResult, TTaskResult> >() != null);

            return(new AsyncNotificationProjection <TResult, TTaskResult>(selector(notification.Value), notification));
        }
 public Task PublishAsync(IAsyncNotification notification)
 {
     return _mediator.PublishAsync(notification.RouteTo(_baseAddress));
 }
Esempio n. 10
0
 public Task PublishAsync(IAsyncNotification notification)
 {
     _logger.LogTrace("PublishAsync {@notification}", notification);
     return(_inner.PublishAsync(notification));
 }
Esempio n. 11
0
 public abstract Task Handle(IAsyncNotification message);
Esempio n. 12
0
 void PublishDomainEvent(IAsyncNotification evt) {
     _eventBus.PublishOnCurrentThread(evt);
     _mediator.PublishAsync(evt);
 }
 public Task PublishAsync(IAsyncNotification notification)
 {
     throw new NotSupportedException();
 }
Esempio n. 14
0
 public Task PublishAsync(IAsyncNotification notification)
 {
     throw new NotImplementedException();
 }