public static Func <bool> IsGuidNotEmpty(Guid guid, string notification)
        {
            return(delegate
            {
                if (Guid.Empty != guid)
                {
                    return true;
                }

                MessagesFacade.AddMessage(notification);

                return false;
            });
        }
        public static Func <bool> IsGuidNotNull(Guid?guid, string notification)
        {
            return(delegate
            {
                if (guid != null)
                {
                    return true;
                }

                MessagesFacade.AddMessage(notification);

                return false;
            });
        }
        public static Func <bool> IsStringNotNullOrWhiteSpace(string value, string notification)
        {
            return(delegate
            {
                if (!string.IsNullOrWhiteSpace(value))
                {
                    return true;
                }

                MessagesFacade.AddMessage(notification);

                return false;
            });
        }
        public static Func <bool> IsLowerThan(
            decimal?left,
            decimal right,
            string notification)
        {
            return(delegate
            {
                if (left > right)
                {
                    return true;
                }

                MessagesFacade.AddMessage(notification);

                return false;
            });
        }
        public static Func <bool> IsDateEqual(
            DateTime left,
            DateTime right,
            string notification)
        {
            return(delegate
            {
                if (left.Date != right.Date)
                {
                    return true;
                }

                MessagesFacade.AddMessage(notification);

                return false;
            });
        }
        public static Func <bool> IsEqual(
            int left,
            int right,
            string notification)
        {
            return(delegate
            {
                if (left == right)
                {
                    return true;
                }

                MessagesFacade.AddMessage(notification);

                return false;
            });
        }
        public static Func <bool> HasLengthEqual(
            string value,
            int length,
            string notification)
        {
            return(delegate
            {
                if (value.Length == length)
                {
                    return true;
                }

                MessagesFacade.AddMessage(notification);

                return false;
            });
        }
        public static Func <bool> HasMinimumLength(
            string value,
            int minLength,
            string notification)
        {
            return(delegate
            {
                if (value.Length > minLength)
                {
                    return true;
                }

                MessagesFacade.AddMessage(notification);

                return false;
            });
        }
        public static Func <bool> IsGreaterThanOrEqual(
            DateTime?left,
            DateTime right,
            string notification)
        {
            return(delegate
            {
                if (left <= right)
                {
                    return true;
                }

                MessagesFacade.AddMessage(notification);

                return false;
            });
        }
 public static bool HasNotifications() => MessagesFacade.HasMessages();
Example #11
0
 public MessagesController()
 {
     _messagesFacade = new MessagesFacade();
 }