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

◆ Aggregate()

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

Reimplemented from System.Data.Common.DataStorage.

Definition at line 19 of file SqlBinaryStorage.cs.

20 {
21 try
22 {
23 switch (kind)
24 {
25 case AggregateType.First:
26 if (records.Length != 0)
27 {
28 return _values[records[0]];
29 }
30 return null;
31 case AggregateType.Count:
32 {
33 int num = 0;
34 for (int i = 0; i < records.Length; i++)
35 {
36 if (!IsNull(records[i]))
37 {
38 num++;
39 }
40 }
41 return num;
42 }
43 }
44 }
45 catch (OverflowException)
46 {
47 throw ExprException.Overflow(typeof(SqlBinary));
48 }
49 throw ExceptionBuilder.AggregateException(kind, _dataType);
50 }

References System.Data.Common.DataStorage._dataType, System.Data.Common.SqlBinaryStorage._values, System.Data.ExceptionBuilder.AggregateException(), System.Xml.Dictionary, System.Data.IsNull, and System.Data.ExprException.Overflow().