-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOperator.cs
75 lines (73 loc) · 3.25 KB
/
Operator.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
namespace Crud.Api.QueryModels
{
public static class Operator
{
public const String And = "&&";
public const String Or = "||";
public const String Equality = "==";
public const String Inequality = "!=";
public const String GreaterThan = ">";
public const String GreaterThanOrEquals = ">=";
public const String LessThan = "<";
public const String LessThanOrEquals = "<=";
/// <summary>
/// If any value in <see cref="Condition.Field"/> matches any value in <see cref="Condition.Values"/>.
/// </summary>
public const String In = "IN";
/// <summary>
/// If all values in <see cref="Condition.Field"/> do not match any value in <see cref="Condition.Values"/>.
/// </summary>
public const String NotIn = "NIN";
/// <summary>
/// If all values in <see cref="Condition.Values"/> match any value in <see cref="Condition.Field"/>.
/// </summary>
public const String All = "ALL";
/// <summary>
/// For use with <see cref="Condition.Field"/> properties of type <see cref="String"/>. If value in <see cref="Condition.Field"/> contains the value in <see cref="Condition.Value"/>.
/// </summary>
public const String Contains = "CONTAINS";
/// <summary>
/// For use with <see cref="Condition.Field"/> properties of type <see cref="String"/>. If value in <see cref="Condition.Field"/> starts with the value in <see cref="Condition.Value"/>.
/// </summary>
public const String StartsWith = "STARTSWITH";
/// <summary>
/// For use with <see cref="Condition.Field"/> properties of type <see cref="String"/>. If value in <see cref="Condition.Field"/> ends with the value in <see cref="Condition.Value"/>.
/// </summary>
public const String EndsWith = "ENDSWITH";
public static IReadOnlyDictionary<String, String> LogicalAliasLookup = new Dictionary<String, String>(StringComparer.OrdinalIgnoreCase)
{
{ And, And },
{ "AND", And },
{ Or, Or },
{ "OR", Or }
};
public static IReadOnlyDictionary<String, String> ComparisonAliasLookup = new Dictionary<String, String>(StringComparer.OrdinalIgnoreCase)
{
{ Equality, Equality },
{ "Equals", Equality },
{ "EQ", Equality },
{ Inequality, Inequality },
{ "NotEquals", Inequality },
{ "NE", Inequality },
{ GreaterThan, GreaterThan },
{ "GreaterThan", GreaterThan },
{ "GT", GreaterThan },
{ GreaterThanOrEquals, GreaterThanOrEquals },
{ "GreaterThanOrEquals", GreaterThanOrEquals },
{ "GTE", GreaterThanOrEquals },
{ LessThan, LessThan },
{ "LessThan", LessThan },
{ "LT", LessThan },
{ LessThanOrEquals, LessThanOrEquals },
{ "LessThanOrEquals", LessThanOrEquals },
{ "LTE", LessThanOrEquals },
{ In, In },
{ NotIn, NotIn },
{ "NotIn", NotIn },
{ All, All },
{ Contains, Contains },
{ StartsWith, StartsWith },
{ EndsWith, EndsWith }
};
}
}