public Task Handle(ExtractSent notification, CancellationToken cancellationToken) { var metric = new AppMetric(notification.Version, notification.Name, JsonConvert.SerializeObject(notification)); _repository.Clear(notification.Name, "NoSent"); _repository.Create(metric); _repository.SaveChanges(); return(Task.CompletedTask); }
public Task Handle(HandshakeEnd notification, CancellationToken cancellationToken) { var session = _repository.GetSession(notification.EndName); notification.UpdateSession(session); var metric = new AppMetric(notification.Version, notification.Name, JsonConvert.SerializeObject(notification)); _repository.Clear(notification.Name); _repository.Create(metric); _repository.SaveChanges(); return(Task.CompletedTask); }
public Task Handle(ExtractLoaded notification, CancellationToken cancellationToken) { var cargoes = _repository.LoadCargo().ToList(); if (notification.Name == "CareTreatment") { var detainedCargoes = _repository.LoadDetainedCargo().ToList(); cargoes.AddRange(detainedCargoes); } notification.AddCargo(cargoes); var metric = new AppMetric(notification.Version, notification.Name, JsonConvert.SerializeObject(notification)); _repository.Clear(notification.Name, "NoLoaded"); _repository.Create(metric); _repository.SaveChanges(); return(Task.CompletedTask); }