protected virtual async Task Handle(IHandlerData data) { if (_nextHandler != null) { await _nextHandler?.Handle(data); } }
public async Task Handle(IHandlerData telegram) { await new ExceptionHandler() .SetRoot() .Next(new DownloadMp3()) .Next((new SendMp3ToUser())) .Next(new NotifyAdmins()) .Run(telegram); }
public async Task Run(IHandlerData data) { if (_isRoot) { await Handle(data); } else { _prevHandler?.Run(data); } }
protected override async Task Handle(IHandlerData data) { try { await base.Handle(data); } catch (Exception e) { Console.WriteLine(e); //handle the exception here } }
protected override async Task Handle(IHandlerData data) { if (!(data is OrderData order)) { throw new ArgumentNullException(); } order.State = nameof(ProducingHandler); Console.WriteLine($"State:{nameof(ProducingHandler)} objectState: " + $"{JsonConvert.SerializeObject(order)}"); await base.Handle(order); }
protected override async Task Handle(IHandlerData data) { Console.WriteLine("Sending MP3 to user ..."); await base.Handle(data); }
public Task Handle(IHandlerData telegram) { throw new System.NotImplementedException(); }
public IHandlerData SetNext(IHandlerData handler) { this._nextHandler = handler; return(handler); }
protected override async Task Handle(IHandlerData data) { Console.WriteLine("Downloading ... "); await base.Handle(data); }
public MessageBus(IHandlerData handlerData, IOptions <MessageQueueConfiguration> messageQueueConfiguration) { _messageQueueConfiguration = messageQueueConfiguration.Value; _handlerData = handlerData; _queueClient = new QueueClient(_messageQueueConfiguration.Connectionstring, _messageQueueConfiguration.QueueName); }
protected override async Task Handle(IHandlerData data) { Console.WriteLine("Notifying Admins ..."); await base.Handle(data); }