public void Handle(SeatToDefineStudentNotificationSent @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.SeatId = @event.SeatId; entity.SessionId = @event.SessionId; entity.CompanyId = @event.CompanyId; entity.Label = "Stagiaire(s) à définir"; entity.AffectedRole = UserRole.Manager; entity.ReminderType = NotificationType.StudentToDefine; context.SaveChanges(); } }
private void Handle(SeatToDefineStudentNotificationSent @event) { Notifications.Add(new FakeNotification(@event.NotificationId, NotificationType.StudentToDefine)); }