Created
July 1, 2016 18:08
-
-
Save jnm2/f1daecadfb9c986a3d3de5ac9cd72f0d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class DbFunctionExpressions | |
{ | |
private static readonly MethodInfo BinaryDummyMethodInfo = typeof(DbFunctionExpressions).GetMethod(nameof(BinaryDummyMethod), BindingFlags.Static | BindingFlags.NonPublic); | |
private static bool BinaryDummyMethod(byte[] left, byte[] right) | |
{ | |
throw new NotImplementedException(); | |
} | |
public static Expression BinaryLessThan(Expression left, Expression right) | |
{ | |
if (left.Type != typeof(byte[])) throw new ArgumentException("Operands must be of type byte[].", nameof(left)); | |
if (right.Type != typeof(byte[])) throw new ArgumentException("Operands must be of type byte[].", nameof(right)); | |
return Expression.LessThan(left, right, false, BinaryDummyMethodInfo); | |
} | |
public static Expression BinaryLessThanOrEqual(Expression left, Expression right) | |
{ | |
if (left.Type != typeof(byte[])) throw new ArgumentException("Operands must be of type byte[].", nameof(left)); | |
if (right.Type != typeof(byte[])) throw new ArgumentException("Operands must be of type byte[].", nameof(right)); | |
return Expression.LessThanOrEqual(left, right, false, BinaryDummyMethodInfo); | |
} | |
public static Expression BinaryGreaterThan(Expression left, Expression right) | |
{ | |
if (left.Type != typeof(byte[])) throw new ArgumentException("Operands must be of type byte[].", nameof(left)); | |
if (right.Type != typeof(byte[])) throw new ArgumentException("Operands must be of type byte[].", nameof(right)); | |
return Expression.GreaterThan(left, right, false, BinaryDummyMethodInfo); | |
} | |
public static Expression BinaryGreaterThanOrEqual(Expression left, Expression right) | |
{ | |
if (left.Type != typeof(byte[])) throw new ArgumentException("Operands must be of type byte[].", nameof(left)); | |
if (right.Type != typeof(byte[])) throw new ArgumentException("Operands must be of type byte[].", nameof(right)); | |
return Expression.GreaterThanOrEqual(left, right, false, BinaryDummyMethodInfo); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment