private static ExpressionStarter <T> HandleDate <T>(ExpressionStarter <T> predicate, object value, string domainName,
                                                            PropertyComparisonTypeEnum propertyComparison, ExpressionCombinationTypeEnum expressionCombination, Type type)
        {
            if (value == null)
            {
                return(predicate);
            }


            if (CheckIfDefaultValue(value, type))
            {
                return(predicate);
            }

            Expression <Func <T, bool> > condition = GetExpression <T>(propertyComparison, value, domainName);


            switch (expressionCombination)
            {
            case ExpressionCombinationTypeEnum.And:
                predicate.And(condition);
                break;

            case ExpressionCombinationTypeEnum.Or:
                predicate.Or(condition);
                break;

            default:
                predicate.And(condition);
                break;
            }

            return(predicate);
        }
        private static ExpressionStarter <T> HandleText <T>(ExpressionStarter <T> predicate, object value, string domainName,
                                                            PropertyComparisonTypeEnum propertyComparison, ExpressionCombinationTypeEnum expressionCombination, Type type, bool toLower)
        {
            if (value == null)
            {
                return(predicate);
            }

            if (CheckIfDefaultValue(value, type))
            {
                return(predicate);
            }

            Expression <Func <T, bool> > condition = null;

            switch (propertyComparison)
            {
            case PropertyComparisonTypeEnum.Equals:
                if (type.Name.ToLower().Contains("char"))
                {
                    condition = GetExpressionEqual <T>(domainName, value);
                }
                else
                {
                    condition = toLower == true?GetExpressionEqualWithToLower <T>(domainName, value) : GetExpressionEqual <T>(domainName, value);
                }
                break;

            case PropertyComparisonTypeEnum.Contains:
                if (type.Name.ToLower().Contains("char"))
                {
                    condition = GetExpressionContains <T>(domainName, value);
                }
                else
                {
                    condition = toLower == true?GetExpressionContainsWithToLower <T>(domainName, value) : GetExpressionContains <T>(domainName, value);
                }
                break;

            case PropertyComparisonTypeEnum.NotEqual:
                condition = GetExpressionNotEqual <T>(domainName, value);
                break;

            default:
                if (type.Name.ToLower().Contains("char"))
                {
                    condition = GetExpressionEqual <T>(domainName, value);
                }
                else
                {
                    condition = toLower == true?GetExpressionEqualWithToLower <T>(domainName, value) : GetExpressionEqual <T>(domainName, value);
                }
                break;
            }

            switch (expressionCombination)
            {
            case ExpressionCombinationTypeEnum.And:
                predicate.And(condition);
                break;

            case ExpressionCombinationTypeEnum.Or:
                predicate.Or(condition);
                break;

            default:
                predicate.And(condition);
                break;
            }

            return(predicate);
        }
        private static ExpressionStarter <T> SwitchOnType <T>(string handleType, ExpressionStarter <T> predicate, object value, string domainName,
                                                              PropertyComparisonTypeEnum propertyComparison, ExpressionCombinationTypeEnum customCombination, Type type, bool toLower)
        {
            switch (handleType)
            {
            case "number":
                predicate = HandleNumber(predicate, value, domainName, propertyComparison, customCombination, type);
                break;

            case "text":
                predicate = HandleText(predicate, value, domainName, propertyComparison, customCombination, type, toLower);
                break;

            case "date":
                predicate = HandleDate(predicate, value, domainName, propertyComparison, customCombination, type);
                break;

            case "bool":
                predicate = HandleBool(predicate, value, domainName, propertyComparison, customCombination);
                break;

            default:
                break;
            }

            return(predicate);
        }