/// <summary> /// /// </summary> /// <param name="memberField"></param> /// <returns></returns> private static Expression IsNullOrEmpty(MemberExpression memberField) => memberField.HasOperator("IsNullOrEmpty") ? Expression.Call(typeof(string), nameof(string.IsNullOrEmpty), null, memberField) : null;
/// <summary> /// /// </summary> /// <param name="memberField"></param> /// <param name="constant"></param> /// <returns></returns> private static Expression EndsWith(MemberExpression memberField, Expression constant) => memberField.HasOperator("EndsWith") ? Expression.Call(memberField, memberField.GetOperator("EndsWith"), Expression.Convert(constant, memberField.Type)) : null;
/// <summary> /// /// </summary> /// <param name="memberField"></param> /// <param name="constant"></param> /// <returns></returns> private static Expression Like(MemberExpression memberField, Expression constant) => memberField.HasOperator("Contains") ? Expression.Call(memberField, memberField.GetOperator("Contains"), Expression.Convert(constant, memberField.Type)) : Equals(memberField, constant);
/// <summary> /// /// </summary> /// <param name="memberField"></param> /// <param name="constant"></param> /// <returns></returns> private static Expression DoesNotStartWith(MemberExpression memberField, Expression constant) => memberField.HasOperator("StartsWith") ? Expression.Not(Expression.Call(memberField, memberField.GetOperator("StartsWith"), Expression.Convert(constant, memberField.Type))) : null;
/// <summary> /// /// </summary> /// <param name="memberField"></param> /// <param name="constant"></param> /// <returns></returns> private static Expression DoesNotContain(MemberExpression memberField, Expression constant) => memberField.HasOperator("Contains") ? Expression.Not(Expression.Call(memberField, memberField.GetOperator("Contains"), Expression.Convert(constant, memberField.Type))) : null;