public static NotificationCollection Create(IList <Notification> notifications)
        {
            NotificationCollection notificationCollection = new NotificationCollection();

            notificationCollection.AddMessage(notifications);
            return(notificationCollection);
        }
        public static NotificationCollection AddError(this NotificationCollection instance, string error, string errorCode)
        {
            var notification = new Notification(error, NotificationSeverity.Error);

            if (!string.IsNullOrEmpty(errorCode))
            {
                notification.Code = errorCode;
            }

            instance.AddMessage(notification);

            return(instance);
        }