2018-02-11 20:55:29 -05:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace PoweredSoft.DynamicLinq
|
|
|
|
|
{
|
|
|
|
|
public enum ConditionOperators
|
|
|
|
|
{
|
|
|
|
|
Equal,
|
2018-02-12 22:27:09 -05:00
|
|
|
|
NotEqual,
|
2018-02-11 20:55:29 -05:00
|
|
|
|
GreaterThan,
|
|
|
|
|
GreaterThanOrEqual,
|
|
|
|
|
LessThan,
|
|
|
|
|
LessThanOrEqual,
|
|
|
|
|
Contains,
|
2019-03-19 17:54:48 -04:00
|
|
|
|
NotContains,
|
2018-02-11 20:55:29 -05:00
|
|
|
|
StartsWith,
|
2018-03-06 22:04:54 -05:00
|
|
|
|
EndsWith,
|
|
|
|
|
In,
|
|
|
|
|
NotIn
|
2018-02-11 20:55:29 -05:00
|
|
|
|
}
|
|
|
|
|
|
2018-02-12 04:30:55 -05:00
|
|
|
|
public enum QueryConvertStrategy
|
|
|
|
|
{
|
|
|
|
|
LeaveAsIs,
|
2018-03-06 19:34:28 -05:00
|
|
|
|
ConvertConstantToComparedPropertyOrField,
|
|
|
|
|
SpecifyType
|
2018-02-12 04:30:55 -05:00
|
|
|
|
}
|
|
|
|
|
|
2018-02-12 22:27:09 -05:00
|
|
|
|
public enum QueryCollectionHandling
|
2018-02-12 21:28:53 -05:00
|
|
|
|
{
|
|
|
|
|
Any,
|
|
|
|
|
All
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-14 19:50:43 -04:00
|
|
|
|
public enum QueryOrderByDirection
|
2018-02-20 22:21:23 -05:00
|
|
|
|
{
|
|
|
|
|
Ascending,
|
|
|
|
|
Descending
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-12 23:26:41 -04:00
|
|
|
|
public enum SelectTypes
|
|
|
|
|
{
|
|
|
|
|
Key,
|
|
|
|
|
Count,
|
|
|
|
|
LongCount,
|
|
|
|
|
Sum,
|
|
|
|
|
Average,
|
2018-03-21 21:00:46 -04:00
|
|
|
|
ToList,
|
2018-10-25 21:02:17 -04:00
|
|
|
|
Path,
|
|
|
|
|
Min,
|
|
|
|
|
Max,
|
|
|
|
|
LastOrDefault,
|
|
|
|
|
FirstOrDefault,
|
|
|
|
|
Last,
|
2018-10-25 22:01:44 -04:00
|
|
|
|
First,
|
2018-03-12 23:26:41 -04:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-21 23:15:45 -04:00
|
|
|
|
public enum SelectCollectionHandling
|
|
|
|
|
{
|
2018-03-26 17:14:01 -04:00
|
|
|
|
LeaveAsIs,
|
|
|
|
|
Flatten
|
2018-03-21 23:15:45 -04:00
|
|
|
|
}
|
|
|
|
|
|
2018-02-11 20:55:29 -05:00
|
|
|
|
internal static class Constants
|
|
|
|
|
{
|
2018-03-08 22:59:18 -05:00
|
|
|
|
internal static readonly MethodInfo GroupByMethod = typeof(Queryable).GetMethods().First(t => t.Name == "GroupBy");
|
2018-03-12 19:00:02 -04:00
|
|
|
|
internal static readonly MethodInfo GroupByMethodWithEqualityComparer = typeof(Queryable).GetMethods().First(t => t.Name == "GroupBy" && t.GetParameters().Any(t2 => t2.Name == "comparer"));
|
2018-03-06 20:43:49 -05:00
|
|
|
|
internal static readonly MethodInfo StringEqualWithComparisation = typeof(string).GetMethod("Equals", new Type[] { typeof(string), typeof(StringComparison) });
|
2018-09-16 02:10:20 -04:00
|
|
|
|
internal static readonly MethodInfo ContainsMethod = typeof(string).GetMethod("Contains", new Type[] { typeof(string) });
|
2018-02-11 20:55:29 -05:00
|
|
|
|
internal static readonly MethodInfo StartsWithMethod = typeof(string).GetMethod("StartsWith", new Type[] { typeof(string) });
|
2018-03-06 20:43:49 -05:00
|
|
|
|
internal static readonly MethodInfo StartsWithMethodWithComparisation = typeof(string).GetMethod("StartsWith", new Type[] { typeof(string), typeof(StringComparison) });
|
2018-02-11 20:55:29 -05:00
|
|
|
|
internal static readonly MethodInfo EndsWithMethod = typeof(string).GetMethod("EndsWith", new Type[] { typeof(string) });
|
2018-03-06 20:43:49 -05:00
|
|
|
|
internal static readonly MethodInfo EndsWithMethodWithComparisation = typeof(string).GetMethod("EndsWith", new Type[] { typeof(string), typeof(StringComparison) });
|
|
|
|
|
internal static readonly MethodInfo IndexOfMethod = typeof(string).GetMethod("IndexOf", new Type[] { typeof(string), typeof(StringComparison) });
|
2018-02-12 21:28:53 -05:00
|
|
|
|
internal static readonly MethodInfo AnyMethod = typeof(Enumerable).GetMethods(BindingFlags.Static | BindingFlags.Public).First(t => t.Name == "Any" && t.GetParameters().Count() == 2);
|
|
|
|
|
internal static readonly MethodInfo AllMethod = typeof(Enumerable).GetMethods(BindingFlags.Static | BindingFlags.Public).First(t => t.Name == "All" && t.GetParameters().Count() == 2);
|
2019-11-27 13:18:33 -05:00
|
|
|
|
internal static readonly MethodInfo CompareToMethod = typeof(string).GetMethod("CompareTo", new Type[] { typeof(string) });
|
2018-02-11 20:55:29 -05:00
|
|
|
|
}
|
|
|
|
|
}
|