public static async Task SendNotification(NotificationMessage notificationMessage) { CloudNotification cloudNotification = null; switch (notificationMessage.NotificationType) { case NotificationType.Email: cloudNotification = new EmailNotification(); break; case NotificationType.Fcm: cloudNotification = new FcmNotification(); break; } if (cloudNotification != null) { await cloudNotification.sendNotification(notificationMessage); } }
public EmailService(CloudNotification cloudNotification) { this.cloudNotification = cloudNotification; }