public void Handle(AgreementToSignNotificationSent @event) { using (var context = new ProjectionContext(ConnectionString.Get())) { var entity = context.Notifications.FirstOrDefault(a => a.Id == @event.NotificationId); if (entity == null) { entity = new NotificationSqlEntity(); context.Notifications.Add(entity); } entity.Id = @event.NotificationId; entity.SessionId = @event.SessionId; entity.CompanyId = @event.CompanyId; entity.AgreementId = @event.AgreementId; entity.ReminderType = NotificationType.AgreementToSign; entity.AffectedRole = UserRole.Operator; entity.Label = "Convention(s) à retourner signée(s)"; context.SaveChanges(); } }
private void Handle(AgreementToSignNotificationSent @event) { Notifications.Add(new FakeNotification(@event.NotificationId, NotificationType.AgreementToSign, @event.AgreementId)); }