Пример #1
0
 public SendNotificationObject(string senderUserName, NotificationData notificationData, NotificationType.NotificationTypes notificationType)
 {
     SenderUserName   = senderUserName;
     NotificationData = notificationData;
     NotificationName = NotificationResolver.ResolveNotification(notificationType);
     NotificationType = notificationType;
 }
Пример #2
0
        public static string ResolveNotification(NotificationType.NotificationTypes notificationType)
        {
            switch (notificationType)
            {
            case NotificationType.NotificationTypes.UserCreated:
                return(NotificationNames.UserCreated);

            case NotificationType.NotificationTypes.UserDeleted:
                return(NotificationNames.UserDeleted);

            case NotificationType.NotificationTypes.RoleCreated:
                return(NotificationNames.RoleCreated);

            case NotificationType.NotificationTypes.RoleDeleted:
                return(NotificationNames.RoleDeleted);

            case NotificationType.NotificationTypes.RoleAssigned:
                return(NotificationNames.RoleAssigned);

            default:
                throw new ArgumentOutOfRangeException(nameof(notificationType), notificationType, null);
            }
        }