Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Aggregate()

override object System.Data.Common.SqlDateTimeStorage.Aggregate ( int[] records,
AggregateType kind )
inlinevirtual

Reimplemented from System.Data.Common.DataStorage.

Definition at line 19 of file SqlDateTimeStorage.cs.

20 {
21 bool flag = false;
22 try
23 {
24 switch (kind)
25 {
26 case AggregateType.Min:
27 {
29 foreach (int num3 in records)
30 {
31 if (!IsNull(num3))
32 {
34 {
36 }
37 flag = true;
38 }
39 }
40 if (flag)
41 {
42 return sqlDateTime2;
43 }
44 return _nullValue;
45 }
46 case AggregateType.Max:
47 {
49 foreach (int num2 in records)
50 {
51 if (!IsNull(num2))
52 {
54 {
56 }
57 flag = true;
58 }
59 }
60 if (flag)
61 {
62 return sqlDateTime;
63 }
64 return _nullValue;
65 }
66 case AggregateType.First:
67 if (records.Length != 0)
68 {
69 return _values[records[0]];
70 }
71 return null;
72 case AggregateType.Count:
73 {
74 int num = 0;
75 for (int i = 0; i < records.Length; i++)
76 {
77 if (!IsNull(records[i]))
78 {
79 num++;
80 }
81 }
82 return num;
83 }
84 }
85 }
86 catch (OverflowException)
87 {
88 throw ExprException.Overflow(typeof(SqlDateTime));
89 }
90 throw ExceptionBuilder.AggregateException(kind, _dataType);
91 }
static SqlBoolean LessThan(SqlDateTime x, SqlDateTime y)
static readonly SqlDateTime MaxValue
static SqlBoolean GreaterThan(SqlDateTime x, SqlDateTime y)
static readonly SqlDateTime MinValue

References System.Data.Common.DataStorage._dataType, System.Data.Common.DataStorage._nullValue, System.Data.Common.SqlDateTimeStorage._values, System.Data.ExceptionBuilder.AggregateException(), System.Xml.Dictionary, System.Data.SqlTypes.SqlDateTime.GreaterThan(), System.Data.IsNull, System.Data.SqlTypes.SqlDateTime.LessThan(), System.Data.SqlTypes.SqlDateTime.MaxValue, System.Data.SqlTypes.SqlDateTime.MinValue, and System.Data.ExprException.Overflow().