public async Task <AppointmentRequestNotification> PublishAppointmentRequestNotification(AppointmentRequest appointmentRequest, DateTime timestamp, string message) { var notification = new AppointmentRequestNotification(); await Create(notification); notification.IsActive = true; notification.AppointmentRequest = appointmentRequest; notification.Timestamp = timestamp; notification.Status = NotificationStatus.Unread; notification.Message = message; return(await Update(notification) as AppointmentRequestNotification); }
public override DataTemplate SelectTemplate(object item, DependencyObject container) { var selectedTemplate = SurgeryNotificationTemplate; var notification = item as Notification; selectedTemplate = notification switch { SurgeryNotification _ => SurgeryNotificationTemplate, SurgeryRequestNotification _ => SurgeryRequestNotificationTemplate, AppointmentRequestNotification _ => AppointmentRequestNotificationTemplate, AppointmentChangeRequestNotification _ => AppointmentChangeRequestNotificationTemplate, _ => selectedTemplate }; return(selectedTemplate); } }