15 types derived from SqlExpression
System.Data.Linq (15)
SqlClient\Common\SqlNode.cs (15)
198
internal abstract class SqlSimpleTypeExpression :
SqlExpression
{
231
internal class SqlDiscriminatedType :
SqlExpression
{
572
internal class SqlAliasRef :
SqlExpression
{
748
internal class SqlLift :
SqlExpression
{
1148
internal class SqlSearchedCase :
SqlExpression
{
1192
internal class SqlSimpleCase :
SqlExpression
{
1236
internal class SqlClientCase :
SqlExpression
{
1314
internal class SqlTypeCase :
SqlExpression
{
1470
internal class SqlColumn :
SqlExpression
{
1544
internal class SqlColumnRef :
SqlExpression
{
1838
internal class SqlExprSet :
SqlExpression
{
2099
internal class SqlDoNotVisitExpression :
SqlExpression
{
2204
internal class SqlSharedExpression :
SqlExpression
{
2229
internal class SqlSharedExpressionRef :
SqlExpression
{
2246
internal class SqlSimpleExpression :
SqlExpression
{
1638 references to SqlExpression
System.Data.Linq (1638)
SqlClient\Common\Expressions.cs (1)
25
internal static KnownExpression Known(
SqlExpression
expr) {
SqlClient\Common\SqlFactory.cs (140)
33
internal
SqlExpression
ConvertTo(Type clrType, ProviderType sqlType,
SqlExpression
expr) {
37
internal
SqlExpression
ConvertTo(Type clrType,
SqlExpression
expr) {
60
internal
SqlExpression
ConvertToBigint(
SqlExpression
expr) {
64
internal
SqlExpression
ConvertToInt(
SqlExpression
expr) {
68
internal
SqlExpression
ConvertToDouble(
SqlExpression
expr) {
75
internal
SqlExpression
ConvertTimeToDouble(
SqlExpression
exp) {
79
internal
SqlExpression
ConvertToBool(
SqlExpression
expr) {
83
internal
SqlExpression
ConvertToDateTime(
SqlExpression
expr) {
87
internal
SqlExpression
AndAccumulate(
SqlExpression
left,
SqlExpression
right) {
99
internal
SqlExpression
OrAccumulate(
SqlExpression
left,
SqlExpression
right) {
111
internal
SqlExpression
Concat(params
SqlExpression
[] expressions) {
112
SqlExpression
result = expressions[expressions.Length - 1];
119
internal
SqlExpression
Add(params
SqlExpression
[] expressions) {
120
SqlExpression
sum = expressions[expressions.Length - 1];
127
internal
SqlExpression
Subtract(
SqlExpression
first,
SqlExpression
second) {
131
internal
SqlExpression
Multiply(params
SqlExpression
[] expressions) {
132
SqlExpression
result = expressions[expressions.Length - 1];
139
internal
SqlExpression
Divide(
SqlExpression
first,
SqlExpression
second) {
143
internal
SqlExpression
Add(
SqlExpression
expr, int second) {
147
internal
SqlExpression
Subtract(
SqlExpression
expr, int second) {
151
internal
SqlExpression
Multiply(
SqlExpression
expr, long second) {
155
internal
SqlExpression
Divide(
SqlExpression
expr, long second) {
159
internal
SqlExpression
Mod(
SqlExpression
expr, long second) {
167
internal
SqlExpression
LEN(
SqlExpression
expr) {
168
return FunctionCall(typeof(int), "LEN", new
SqlExpression
[] { expr }, expr.SourceExpression);
175
internal
SqlExpression
DATALENGTH(
SqlExpression
expr) {
176
return FunctionCall(typeof(int), "DATALENGTH", new
SqlExpression
[] { expr }, expr.SourceExpression);
183
internal
SqlExpression
CLRLENGTH(
SqlExpression
expr) {
187
internal
SqlExpression
DATEPART(string partName,
SqlExpression
expr) {
191
new
SqlExpression
[] {
199
internal
SqlExpression
DATEADD(string partName,
SqlExpression
value,
SqlExpression
expr) {
203
internal
SqlExpression
DATEADD(string partName,
SqlExpression
value,
SqlExpression
expr, Expression sourceExpression, bool asNullable) {
209
new
SqlExpression
[] {
217
internal
SqlExpression
DATETIMEOFFSETADD(string partName,
SqlExpression
value,
SqlExpression
expr) {
221
internal
SqlExpression
DATETIMEOFFSETADD(string partName,
SqlExpression
value,
SqlExpression
expr, Expression sourceExpression, bool asNullable) {
227
new
SqlExpression
[] {
237
internal
SqlExpression
AddTimeSpan(
SqlExpression
dateTime,
SqlExpression
timeSpan) {
241
internal
SqlExpression
AddTimeSpan(
SqlExpression
dateTime,
SqlExpression
timeSpan, bool asNullable) {
244
SqlExpression
ns = DATEPART("NANOSECOND", timeSpan);
245
SqlExpression
ms = DATEPART("MILLISECOND", timeSpan);
246
SqlExpression
ss = DATEPART("SECOND", timeSpan);
247
SqlExpression
mi = DATEPART("MINUTE", timeSpan);
248
SqlExpression
hh = DATEPART("HOUR", timeSpan);
250
SqlExpression
result = dateTime;
266
internal static bool IsSqlDateTimeType(
SqlExpression
exp) {
271
internal static bool IsSqlDateType(
SqlExpression
exp) {
275
internal static bool IsSqlTimeType(
SqlExpression
exp) {
279
internal static bool IsSqlDateTimeOffsetType(
SqlExpression
exp) {
283
internal static bool IsSqlHighPrecisionDateTimeType(
SqlExpression
exp) {
288
internal
SqlExpression
Value(Type clrType, ProviderType sqlType, object value, bool isClientSpecified, Expression sourceExpression) {
299
internal
SqlExpression
StaticType(MetaType typeOf, Expression sourceExpression) {
312
internal
SqlExpression
DiscriminatedType(
SqlExpression
discriminator, MetaType targetType) {
320
internal SqlUnary Unary(SqlNodeType nodeType,
SqlExpression
expression) {
328
internal SqlUnary Unary(SqlNodeType nodeType,
SqlExpression
expression, Expression sourceExpression) {
332
internal SqlUnary Unary(SqlNodeType nodeType,
SqlExpression
expression, MethodInfo method, Expression sourceExpression) {
363
internal SqlUnary UnaryConvert(Type targetClrType, ProviderType targetSqlType,
SqlExpression
expression, Expression sourceExpression) {
369
internal SqlUnary UnaryValueOf(
SqlExpression
expression, Expression sourceExpression) {
374
internal SqlBinary Binary(SqlNodeType nodeType,
SqlExpression
left,
SqlExpression
right) {
378
internal SqlBinary Binary(SqlNodeType nodeType,
SqlExpression
left,
SqlExpression
right, MethodInfo method) {
382
internal SqlBinary Binary(SqlNodeType nodeType,
SqlExpression
left,
SqlExpression
right, Type clrType) {
386
internal SqlBinary Binary(SqlNodeType nodeType,
SqlExpression
left,
SqlExpression
right, MethodInfo method, Type clrType) {
418
internal SqlBetween Between(
SqlExpression
expr,
SqlExpression
start,
SqlExpression
end, Expression source) {
422
internal SqlIn In(
SqlExpression
expr, IEnumerable<
SqlExpression
> values, Expression source) {
426
internal SqlLike Like(
SqlExpression
expr,
SqlExpression
pattern,
SqlExpression
escape, Expression source) {
432
internal SqlSearchedCase SearchedCase(SqlWhen[] whens,
SqlExpression
@else, Expression sourceExpression) {
441
internal
SqlExpression
Case(Type clrType,
SqlExpression
discriminator, List<
SqlExpression
> matches, List<
SqlExpression
> values, Expression sourceExpression) {
446
foreach (
SqlExpression
value in values) {
465
internal
SqlExpression
Parameter(object value, Expression source) {
471
internal
SqlExpression
ValueFromObject(object value, Expression sourceExpression) {
475
internal
SqlExpression
ValueFromObject(object value, bool isClientSpecified, Expression sourceExpression) {
485
internal
SqlExpression
ValueFromObject(object value, Type clrType, bool isClientSpecified, Expression sourceExpression) {
493
public
SqlExpression
TypedLiteralNull(Type type, Expression sourceExpression) {
497
internal SqlMember Member(
SqlExpression
expr, MetaDataMember member) {
501
internal SqlMember Member(
SqlExpression
expr, MemberInfo member) {
512
internal
SqlExpression
TypeCase(Type clrType, MetaType rowType,
SqlExpression
discriminator, IEnumerable<SqlTypeCaseWhen> whens, Expression sourceExpression) {
516
internal SqlNew New(MetaType type, ConstructorInfo cons, IEnumerable<
SqlExpression
> args, IEnumerable<MemberInfo> argMembers, IEnumerable<SqlMemberAssign> bindings, Expression sourceExpression) {
521
internal SqlMethodCall MethodCall(MethodInfo method,
SqlExpression
obj,
SqlExpression
[] args, Expression sourceExpression) {
525
internal SqlMethodCall MethodCall(Type returnType, MethodInfo method,
SqlExpression
obj,
SqlExpression
[] args, Expression sourceExpression) {
530
internal SqlExprSet ExprSet(
SqlExpression
[] exprs, Expression sourceExpression) {
560
internal SqlDoNotVisitExpression DoNotVisitExpression(
SqlExpression
expr) {
564
internal SqlFunctionCall FunctionCall(Type clrType, string name, IEnumerable<
SqlExpression
> args, Expression source) {
569
internal SqlFunctionCall FunctionCall(Type clrType, ProviderType sqlType, string name, IEnumerable<
SqlExpression
> args, Expression source) {
573
internal SqlTableValuedFunctionCall TableValuedFunctionCall(MetaType rowType, Type clrType, string name, IEnumerable<
SqlExpression
> args, Expression source) {
593
internal SqlJoin MakeJoin(SqlJoinType joinType, SqlSource location, SqlAlias alias,
SqlExpression
condition, Expression source) {
SqlClient\Common\SqlNode.cs (207)
216
SqlExpression
obj;
217
internal SqlDiscriminatorOf(
SqlExpression
obj, Type clrType, ProviderType sqlType, Expression sourceExpression)
221
internal
SqlExpression
Object {
233
private
SqlExpression
discriminator;
235
internal SqlDiscriminatedType(ProviderType sqlType,
SqlExpression
discriminator, MetaType targetType, Expression sourceExpression)
248
internal
SqlExpression
Discriminator {
271
private
SqlExpression
top;
274
private
SqlExpression
selection;
277
private
SqlExpression
where;
278
private List<
SqlExpression
> groupBy;
279
private
SqlExpression
having;
284
internal SqlSelect(
SqlExpression
selection, SqlSource from, Expression sourceExpression)
289
this.groupBy = new List<
SqlExpression
>();
294
internal
SqlExpression
Top {
309
internal
SqlExpression
Selection {
332
internal
SqlExpression
Where {
342
internal List<
SqlExpression
> GroupBy {
346
internal
SqlExpression
Having {
424
private
SqlExpression
projection;
425
private List<
SqlExpression
> args;
428
internal SqlUserQuery(SqlNodeType nt,
SqlExpression
projection, IEnumerable<
SqlExpression
> args, Expression source)
431
this.args = (args != null) ? new List<
SqlExpression
>(args) : new List<
SqlExpression
>();
435
internal SqlUserQuery(string queryText,
SqlExpression
projection, IEnumerable<
SqlExpression
> args, Expression source)
439
this.args = (args != null) ? new List<
SqlExpression
>(args) : new List<
SqlExpression
>();
447
internal
SqlExpression
Projection {
456
internal List<
SqlExpression
> Arguments {
476
internal SqlStoredProcedureCall(MetaFunction function,
SqlExpression
projection, IEnumerable<
SqlExpression
> args, Expression source)
565
if (!(value is
SqlExpression
|| value is SqlSelect || value is SqlTable || value is SqlUnion))
594
SqlExpression
exp = node as
SqlExpression
;
613
SqlExpression
exp = node as
SqlExpression
;
633
private
SqlExpression
condition;
635
internal SqlJoin(SqlJoinType type, SqlSource left, SqlSource right,
SqlExpression
cond, Expression sourceExpression)
666
internal
SqlExpression
Condition {
717
if (!(node is
SqlExpression
|| node is SqlSelect || node is SqlUnion))
722
SqlExpression
exp = this.Left as
SqlExpression
;
732
SqlExpression
exp = this.Left as
SqlExpression
;
749
internal
SqlExpression
liftedExpression;
751
internal SqlLift(Type type,
SqlExpression
liftedExpression, Expression sourceExpression)
758
internal
SqlExpression
Expression {
779
private
SqlExpression
expression;
781
internal SqlOrderExpression(SqlOrderType type,
SqlExpression
expr) {
791
internal
SqlExpression
Expression {
843
private static SqlColumn UnwrapColumn(
SqlExpression
expr) {
886
private
SqlExpression
operand;
890
internal SqlUnary(SqlNodeType nt, Type clrType, ProviderType sqlType,
SqlExpression
expr, Expression sourceExpression)
894
internal SqlUnary(SqlNodeType nt, Type clrType, ProviderType sqlType,
SqlExpression
expr, MethodInfo method, Expression sourceExpression)
923
internal
SqlExpression
Operand {
938
private
SqlExpression
left;
939
private
SqlExpression
right;
943
internal SqlBinary(SqlNodeType nt, Type clrType, ProviderType sqlType,
SqlExpression
left,
SqlExpression
right)
947
internal SqlBinary(SqlNodeType nt, Type clrType, ProviderType sqlType,
SqlExpression
left,
SqlExpression
right, MethodInfo method)
979
internal
SqlExpression
Left {
988
internal
SqlExpression
Right {
1003
SqlExpression
expression;
1004
SqlExpression
start;
1005
SqlExpression
end;
1007
internal SqlBetween(Type clrType, ProviderType sqlType,
SqlExpression
expr,
SqlExpression
start,
SqlExpression
end, Expression source)
1014
internal
SqlExpression
Expression {
1019
internal
SqlExpression
Start {
1024
internal
SqlExpression
End {
1031
private
SqlExpression
expression;
1032
private List<
SqlExpression
> values;
1034
internal SqlIn(Type clrType, ProviderType sqlType,
SqlExpression
expression, IEnumerable<
SqlExpression
> values, Expression sourceExpression)
1037
this.values = values != null ? new List<
SqlExpression
>(values) : new List<
SqlExpression
>(0);
1040
internal
SqlExpression
Expression {
1049
internal List<
SqlExpression
> Values {
1055
private
SqlExpression
expression;
1056
private
SqlExpression
pattern;
1057
private
SqlExpression
escape;
1059
internal SqlLike(Type clrType, ProviderType sqlType,
SqlExpression
expr,
SqlExpression
pattern,
SqlExpression
escape, Expression source)
1070
internal
SqlExpression
Expression {
1081
internal
SqlExpression
Pattern {
1092
internal
SqlExpression
Escape {
1103
private
SqlExpression
matchExpression;
1104
private
SqlExpression
valueExpression;
1106
internal SqlWhen(
SqlExpression
match,
SqlExpression
value) {
1114
internal
SqlExpression
Match {
1126
internal
SqlExpression
Value {
1150
private
SqlExpression
@else;
1152
internal SqlSearchedCase(Type clrType, IEnumerable<SqlWhen> whens,
SqlExpression
@else, Expression sourceExpression)
1166
internal
SqlExpression
Else {
1193
private
SqlExpression
expression;
1196
internal SqlSimpleCase(Type clrType,
SqlExpression
expr, IEnumerable<SqlWhen> whens, Expression sourceExpression)
1206
internal
SqlExpression
Expression {
1237
private
SqlExpression
expression;
1240
internal SqlClientCase(Type clrType,
SqlExpression
expr, IEnumerable<SqlClientWhen> whens, Expression sourceExpression)
1250
internal
SqlExpression
Expression {
1274
private
SqlExpression
matchExpression;
1275
private
SqlExpression
matchValue;
1277
internal SqlClientWhen(
SqlExpression
match,
SqlExpression
value) {
1285
internal
SqlExpression
Match {
1294
internal
SqlExpression
Value {
1316
private
SqlExpression
discriminator;
1320
internal SqlTypeCase(Type clrType, ProviderType sqlType, MetaType rowType,
SqlExpression
discriminator, IEnumerable<SqlTypeCaseWhen> whens, Expression sourceExpression)
1332
internal
SqlExpression
Discriminator {
1362
private
SqlExpression
match;
1363
private
SqlExpression
@new;
1365
internal SqlTypeCaseWhen(
SqlExpression
match,
SqlExpression
typeBinding) {
1369
internal
SqlExpression
Match {
1377
internal
SqlExpression
TypeBinding {
1442
private
SqlExpression
expression;
1445
internal SqlMember(Type clrType, ProviderType sqlType,
SqlExpression
expr, MemberInfo member)
1455
internal
SqlExpression
Expression {
1475
private
SqlExpression
expression;
1478
internal SqlColumn(Type clrType, ProviderType sqlType, string name, MetaDataMember member,
SqlExpression
expr, Expression sourceExpression)
1492
internal SqlColumn(string name,
SqlExpression
expr)
1519
internal
SqlExpression
Expression {
1600
private
SqlExpression
expression;
1602
internal SqlMemberAssign(MemberInfo member,
SqlExpression
expr)
1614
internal
SqlExpression
Expression {
1625
private
SqlExpression
key;
1626
private
SqlExpression
group;
1628
internal SqlGrouping(Type clrType, ProviderType sqlType,
SqlExpression
key,
SqlExpression
group, Expression sourceExpression)
1636
internal
SqlExpression
Key {
1648
internal
SqlExpression
Group {
1663
private List<
SqlExpression
> args;
1667
internal SqlNew(MetaType metaType, ProviderType sqlType, ConstructorInfo cons, IEnumerable<
SqlExpression
> args, IEnumerable<MemberInfo> argMembers, IEnumerable<SqlMemberAssign> members, Expression sourceExpression)
1675
this.args = new List<
SqlExpression
>();
1697
internal List<
SqlExpression
> Args {
1709
internal
SqlExpression
Find(MemberInfo mi) {
1729
private
SqlExpression
obj;
1730
private List<
SqlExpression
> arguments;
1732
internal SqlMethodCall(Type clrType, ProviderType sqlType, MethodInfo method,
SqlExpression
obj, IEnumerable<
SqlExpression
> args, Expression sourceExpression)
1738
this.arguments = new List<
SqlExpression
>();
1747
internal
SqlExpression
Object {
1758
internal List<
SqlExpression
> Arguments {
1776
private List<
SqlExpression
> expressions;
1778
internal SqlClientArray(Type clrType, ProviderType sqlType,
SqlExpression
[ ] exprs, Expression sourceExpression)
1780
this.expressions = new List<
SqlExpression
>();
1785
internal List<
SqlExpression
> Expressions {
1792
private
SqlExpression
expression;
1794
private List<
SqlExpression
> keyExpressions;
1795
private
SqlExpression
expansion;
1798
internal SqlLink(object id, MetaType rowType, Type clrType, ProviderType sqlType,
SqlExpression
expression, MetaDataMember member, IEnumerable<
SqlExpression
> keyExpressions,
SqlExpression
expansion, Expression sourceExpression)
1805
this.keyExpressions = new List<
SqlExpression
>();
1814
internal
SqlExpression
Expansion {
1820
internal
SqlExpression
Expression {
1829
internal List<
SqlExpression
> KeyExpressions {
1839
private List<
SqlExpression
> expressions;
1841
internal SqlExprSet(Type clrType, IEnumerable <
SqlExpression
> exprs, Expression sourceExpression)
1843
this.expressions = new List<
SqlExpression
>(exprs);
1846
internal List<
SqlExpression
> Expressions {
1854
internal
SqlExpression
GetFirstExpression() {
1855
SqlExpression
expr = expressions[0];
1896
private List<
SqlExpression
> arguments;
1903
this.arguments = new List<
SqlExpression
>();
1916
internal List<
SqlExpression
> Arguments {
1931
private
SqlExpression
expression;
1932
private
SqlExpression
count;
1934
internal SqlJoinedCollection(Type clrType, ProviderType sqlType,
SqlExpression
expression,
SqlExpression
count, Expression sourceExpression)
1940
internal
SqlExpression
Expression {
1949
internal
SqlExpression
Count {
1988
private
SqlExpression
expression;
1992
internal SqlInsert(SqlTable table,
SqlExpression
expr, Expression sourceExpression)
2013
internal
SqlExpression
Expression {
2067
private
SqlExpression
leftValue;
2068
private
SqlExpression
rightValue;
2070
internal SqlAssign(
SqlExpression
lValue,
SqlExpression
rValue, Expression sourceExpression)
2076
internal
SqlExpression
LValue {
2087
internal
SqlExpression
RValue {
2100
private
SqlExpression
expression;
2102
internal SqlDoNotVisitExpression(
SqlExpression
expr)
2109
internal
SqlExpression
Expression {
2119
private
SqlExpression
hasValue;
2120
private
SqlExpression
expressionValue;
2122
internal SqlOptionalValue(
SqlExpression
hasValue,
SqlExpression
value)
2128
internal
SqlExpression
HasValue {
2137
internal
SqlExpression
Value {
2151
private List<
SqlExpression
> arguments;
2153
internal SqlFunctionCall(Type clrType, ProviderType sqlType, string name, IEnumerable <
SqlExpression
> args , Expression source)
2157
internal SqlFunctionCall(SqlNodeType nodeType, Type clrType, ProviderType sqlType, string name , IEnumerable <
SqlExpression
> args , Expression source)
2160
this.arguments = new List<
SqlExpression
>(args);
2167
internal List<
SqlExpression
> Arguments {
2180
internal SqlTableValuedFunctionCall(MetaType rowType, Type clrType, ProviderType sqlType, string name, IEnumerable <
SqlExpression
> args , Expression source)
2205
private
SqlExpression
expr;
2207
internal SqlSharedExpression(
SqlExpression
expr)
2212
internal
SqlExpression
Expression {
2247
private
SqlExpression
expr;
2249
internal SqlSimpleExpression(
SqlExpression
expr)
2254
internal
SqlExpression
Expression {
SqlClient\Common\SqlNodeTypeOperators.cs (1)
176
internal static bool IsClientAidedExpression(this
SqlExpression
expr) {
SqlClient\Common\SqlVisitor.cs (48)
261
internal object Eval(
SqlExpression
expr) {
268
internal virtual
SqlExpression
VisitDoNotVisit(SqlDoNotVisitExpression expr) {
278
internal virtual
SqlExpression
VisitExpression(
SqlExpression
exp) {
279
return (
SqlExpression
)this.Visit(exp);
284
internal virtual
SqlExpression
VisitNop(SqlNop nop) {
287
internal virtual
SqlExpression
VisitLift(SqlLift lift) {
291
internal virtual
SqlExpression
VisitUnaryOperator(SqlUnary uo) {
295
internal virtual
SqlExpression
VisitBinaryOperator(SqlBinary bo) {
304
internal virtual
SqlExpression
VisitAliasRef(SqlAliasRef aref) {
311
internal virtual
SqlExpression
VisitCast(SqlUnary c) {
315
internal virtual
SqlExpression
VisitTreat(SqlUnary t) {
342
internal virtual
SqlExpression
VisitUserColumn(SqlUserColumn suc) {
345
internal virtual
SqlExpression
VisitUserRow(SqlUserRow row) {
354
internal virtual
SqlExpression
VisitNew(SqlNew sox) {
370
internal virtual
SqlExpression
VisitClientQuery(SqlClientQuery cq) {
376
internal virtual
SqlExpression
VisitJoinedCollection(SqlJoinedCollection jc) {
381
internal virtual
SqlExpression
VisitClientArray(SqlClientArray scar) {
387
internal virtual
SqlExpression
VisitClientParameter(SqlClientParameter cp) {
390
internal virtual
SqlExpression
VisitColumn(SqlColumn col) {
394
internal virtual
SqlExpression
VisitColumnRef(SqlColumnRef cref) {
397
internal virtual
SqlExpression
VisitParameter(SqlParameter p) {
400
internal virtual
SqlExpression
VisitValue(SqlValue value) {
403
internal virtual
SqlExpression
VisitSubSelect(SqlSubSelect ss) {
412
internal virtual
SqlExpression
VisitScalarSubSelect(SqlSubSelect ss) {
416
internal virtual
SqlExpression
VisitMultiset(SqlSubSelect sms) {
420
internal virtual
SqlExpression
VisitElement(SqlSubSelect elem) {
424
internal virtual
SqlExpression
VisitExists(SqlSubSelect sqlExpr) {
488
internal virtual
SqlExpression
VisitSearchedCase(SqlSearchedCase c) {
497
internal virtual
SqlExpression
VisitClientCase(SqlClientCase c) {
506
internal virtual
SqlExpression
VisitSimpleCase(SqlSimpleCase c) {
515
internal virtual
SqlExpression
VisitTypeCase(SqlTypeCase tc) {
529
internal virtual
SqlExpression
VisitExprSet(SqlExprSet xs) {
535
internal virtual
SqlExpression
VisitVariable(SqlVariable v) {
538
internal virtual
SqlExpression
VisitOptionalValue(SqlOptionalValue sov) {
543
internal virtual
SqlExpression
VisitBetween(SqlBetween between) {
549
internal virtual
SqlExpression
VisitIn(SqlIn sin) {
556
internal virtual
SqlExpression
VisitLike(SqlLike like) {
562
internal virtual
SqlExpression
VisitFunctionCall(SqlFunctionCall fc) {
568
internal virtual
SqlExpression
VisitTableValuedFunctionCall(SqlTableValuedFunctionCall fc) {
574
internal virtual
SqlExpression
VisitMethodCall(SqlMethodCall mc) {
581
internal virtual
SqlExpression
VisitSharedExpression(SqlSharedExpression shared) {
585
internal virtual
SqlExpression
VisitSharedExpressionRef(SqlSharedExpressionRef sref) {
588
internal virtual
SqlExpression
VisitSimpleExpression(SqlSimpleExpression simple) {
592
internal virtual
SqlExpression
VisitGrouping(SqlGrouping g) {
597
internal virtual
SqlExpression
VisitDiscriminatedType(SqlDiscriminatedType dt) {
601
internal virtual
SqlExpression
VisitDiscriminatorOf(SqlDiscriminatorOf dof) {
613
internal bool RefersToColumn(
SqlExpression
exp, SqlColumn col) {
SqlClient\Query\ContainsRowNumberChecker.cs (2)
48
internal override
SqlExpression
VisitScalarSubSelect(SqlSubSelect ss) {
52
internal override
SqlExpression
VisitSubSelect(SqlSubSelect ss) {
SqlClient\Query\LongTypeConverter.cs (5)
37
private
SqlExpression
ConvertToMax(
SqlExpression
expr, ProviderType newType) {
44
private
SqlExpression
ConvertToMax(
SqlExpression
expr, out bool changed) {
105
internal override
SqlExpression
VisitFunctionCall(SqlFunctionCall fc) {
SqlClient\Query\MethodCallConverter.cs (14)
147
internal override
SqlExpression
VisitBinaryOperator(SqlBinary bo) {
175
private SqlBinary MakeCompareTo(
SqlExpression
left,
SqlExpression
right, SqlNodeType op, int iValue) {
190
private
SqlExpression
CreateComparison(
SqlExpression
a,
SqlExpression
b, Expression source) {
191
SqlExpression
lower = sql.Binary(SqlNodeType.LT, a, b);
192
SqlExpression
equal = sql.Binary(SqlNodeType.EQ2V, a, b);
213
internal override
SqlExpression
VisitMethodCall(SqlMethodCall mc) {
224
List<
SqlExpression
> exprs = null;
235
SqlExpression
sum;
312
private
SqlExpression
TranslateVbIIF(SqlMethodCall mc) {
317
SqlExpression
@else = mc.Arguments[2];
330
internal override
SqlExpression
VisitTreat(SqlUnary t) {
SqlClient\Query\QueryConverter.cs (146)
45
Dictionary<ParameterExpression,
SqlExpression
> map;
55
internal
SqlExpression
ElementOnGroupSource;
84
this.map = new Dictionary<ParameterExpression,
SqlExpression
>();
115
SqlExpression
sqlExpression = retNode as
SqlExpression
;
311
SqlExpression
sqlExpr = (
SqlExpression
)node;
336
SqlExpression
expr = this.VisitExpression(invoke.Expression);
355
SqlExpression
[] args = new
SqlExpression
[invoke.Arguments.Count];
357
args[i] = (
SqlExpression
)this.Visit(invoke.Arguments[i]);
360
return sql.MethodCall(invoke.Type, typeof(Delegate).GetMethod("DynamicInvoke"), expr, new
SqlExpression
[] {sca}, this.dominatingExpression);
399
private
SqlExpression
VisitExpression(Expression exp) {
402
SqlExpression
x = result as
SqlExpression
;
449
SqlExpression
expr = project as
SqlExpression
;
471
SqlExpression
projection = selRef;
492
SqlExpression
outerKey = this.VisitExpression(outerKeySelector.Body);
495
SqlExpression
innerKey = this.VisitExpression(innerKeySelector.Body);
499
SqlExpression
result = this.VisitExpression(resultSelector.Body);
501
SqlExpression
condition = sql.Binary(SqlNodeType.EQ, outerKey, innerKey);
524
SqlExpression
outerKey = this.VisitExpression(outerKeySelector.Body);
527
SqlExpression
innerKey = this.VisitExpression(innerKeySelector.Body);
530
SqlExpression
pred = sql.Binary(SqlNodeType.EQ, outerKey, innerKey);
538
SqlExpression
result = this.VisitExpression(resultSelector.Body);
548
SqlExpression
opt = new SqlOptionalValue(
562
SqlExpression
litNull = sql.TypedLiteralNull(typeof(string), this.dominatingExpression);
615
SqlExpression
expr = this.VisitExpression(b.Expression);
616
SqlExpression
result = null;
638
SqlExpression
expr = node as
SqlExpression
;
651
SqlExpression
exp = this.VisitExpression(c.Operand);
662
SqlExpression
array = this.VisitExpression(b.Left);
663
SqlExpression
index = this.VisitExpression(b.Right);
687
SqlExpression
exp = this.VisitExpression(c.Operand);
688
return sql.MethodCall(c.Type, c.Method, null, new
SqlExpression
[] { exp }, dominatingExpression);
694
SqlExpression
expr = this.VisitExpression(expression);
698
private SqlNode ConvertDateToDateTime2(
SqlExpression
expr) {
699
SqlExpression
datetime2 = new SqlVariable(expr.ClrType, expr.SqlType, "DATETIME2", expr.SourceExpression);
700
return sql.FunctionCall(typeof(DateTime), "CONVERT", new
SqlExpression
[2] { datetime2, expr }, expr.SourceExpression);
703
private SqlNode ChangeType(
SqlExpression
expr, Type type) {
725
expr = (
SqlExpression
) ConvertDateToDateTime2(expr);
808
private
SqlExpression
VisitConditional(ConditionalExpression cond) {
811
SqlExpression
@else = this.VisitExpression(cond.IfFalse);
821
private
SqlExpression
VisitNew(NewExpression qn) {
824
return this.VisitCast(Expression.Convert(qn.Arguments[0], qn.Type)) as
SqlExpression
;
827
return this.VisitCast(Expression.Convert(qn.Arguments[0], typeof(decimal))) as
SqlExpression
;
836
SqlExpression
[] args = null;
839
args = new
SqlExpression
[qn.Arguments.Count];
849
private
SqlExpression
VisitMemberInit(MemberInitExpression init) {
854
SqlExpression
[] args = null;
859
return this.VisitCast(Expression.Convert(qn.Arguments[0], typeof(decimal))) as
SqlExpression
;
863
args = new
SqlExpression
[qn.Arguments.Count];
875
SqlExpression
expr = this.VisitExpression(mb.Expression);
930
SqlExpression
takeExp = this.VisitExpression(count);
940
SqlExpression
skipExp = this.VisitExpression(mce.Arguments[1]);
964
private bool CanSkipOnSelection(
SqlExpression
selection) {
1002
SqlExpression
expr = (
SqlExpression
)node;
1042
SqlExpression
skipExp = this.VisitExpression(skipCount);
1056
private SqlSelect GenerateSkipTake(SqlSelect sequence,
SqlExpression
skipExp,
SqlExpression
takeExp) {
1084
sql.Binary(SqlNodeType.Add, (
SqlExpression
)SqlDuplicator.Copy(skipExp), takeExp),
1143
SqlExpression
sqlExpr;
1162
List<
SqlExpression
> sqlParams = GetFunctionParameters(mce, function);
1169
SqlExpression
projection = this.translator.BuildProjection(aref, function.ResultRowTypes[0].InheritanceRoot, this.allowDeferred, null, mce);
1184
List<
SqlExpression
> sqlParams = GetFunctionParameters(mce, function);
1216
private List<
SqlExpression
> GetFunctionParameters(MethodCallExpression mce, MetaFunction function) {
1217
List<
SqlExpression
> sqlParams = new List<
SqlExpression
>(mce.Arguments.Count);
1221
SqlExpression
newParamExpression = this.VisitExpression(mce.Arguments[i]);
1241
SqlExpression
[] args = new
SqlExpression
[arguments.Length];
1267
SqlExpression
exp = this.VisitExpression(u.Operand);
1270
return sql.MethodCall(u.Type, u.Method, null, new
SqlExpression
[] { exp }, dominatingExpression);
1273
SqlExpression
result = null;
1297
SqlExpression
left = this.VisitExpression(b.Left);
1298
SqlExpression
right = this.VisitExpression(b.Right);
1301
return sql.MethodCall(b.Type, b.Method, null, new
SqlExpression
[] { left, right }, dominatingExpression);
1304
SqlExpression
result = null;
1377
private
SqlExpression
MakeCoalesce(
SqlExpression
left,
SqlExpression
right, Type resultType) {
1386
return sql.SearchedCase(whens.ToArray(), (
SqlExpression
)dup.Duplicate(left), this.dominatingExpression);
1394
private void CompensateForLowerPrecedenceOfDateType(ref
SqlExpression
left, ref
SqlExpression
right) {
1396
right = (
SqlExpression
)ConvertDateToDateTime2(right);
1399
left = (
SqlExpression
)ConvertDateToDateTime2(left);
1440
SqlExpression
any = this.GenerateQuantifier(alias2, sql.Binary(SqlNodeType.EQ2V, aref1, aref2), true);
1464
SqlExpression
any = this.GenerateQuantifier(alias2, sql.Binary(SqlNodeType.EQ2V, aref1, aref2), true);
1501
SqlExpression
expr = this.VisitExpression(expression.Body);
1519
SqlExpression
expr = this.VisitExpression(expression.Body);
1540
SqlExpression
keyExpr = this.VisitExpression(keyLambda.Body);
1550
SqlExpression
keyDup = this.VisitExpression(keyLambda.Body);
1552
SqlExpression
elemExpr = null;
1553
SqlExpression
elemOnGroupSource = null;
1593
SqlExpression
keyGroup = new SqlGrouping(elementType, this.typeProvider.From(elementType), keyExpr, ss, this.dominatingExpression);
1604
SqlExpression
resultExpr = this.VisitExpression(resultSelector.Body);
1615
SqlExpression
resultExpr = new SqlGrouping(elementType, this.typeProvider.From(elementType), keyExpr, ss, this.dominatingExpression);
1673
SqlExpression
exp = (lambda != null) ? this.VisitExpression(lambda.Body) : null;
1674
SqlExpression
where = null;
1703
SqlExpression
exp = null;
1706
this.map[lambda.Parameters[0]] = (
SqlExpression
)SqlDuplicator.Copy(info.ElementOnGroupSource);
1716
SqlExpression
agg = this.GetAggregate(aggType, returnType, exp);
1726
SqlExpression
exp = (lambda != null) ? this.VisitExpression(lambda.Body) : null;
1756
SqlExpression
expr = source as
SqlExpression
;
1771
private
SqlExpression
GetAggregate(SqlNodeType aggType, Type clrType,
SqlExpression
exp) {
1787
SqlExpression
expr = this.VisitExpression(value);
1788
List<
SqlExpression
> list = values.OfType<object>().Select(v => sql.ValueFromObject(v, elemType, true, this.dominatingExpression)).ToList();
1798
private
SqlExpression
GenerateInExpression(
SqlExpression
expr, List<
SqlExpression
> list) {
1806
SqlExpression
pred = sql.Binary(SqlNodeType.EQ, expr, list[0]);
1808
pred = sql.Binary(SqlNodeType.Or, pred, sql.Binary(SqlNodeType.EQ, (
SqlExpression
)SqlDuplicator.Copy(expr), list[i]));
1824
SqlExpression
cond = lambda != null ? this.VisitExpression(lambda.Body) : null;
1828
private
SqlExpression
GenerateQuantifier(SqlAlias alias,
SqlExpression
cond, bool isAny) {
1845
private void CheckContext(
SqlExpression
expr) {
1939
SqlExpression
obj = VisitExpression(mc.Object);
1940
SqlExpression
[] args = new
SqlExpression
[mc.Arguments.Count];
1948
SqlExpression
exp = this.VisitExpression(expression);
2007
List<
SqlExpression
> sqlParams = this.GetFunctionParameters(mc, function);
2412
SqlExpression
sqlExprItem = sql.ValueFromObject(conItem.Value, true, source);
2447
SqlExpression
projection = this.VisitExpression(resultSelector.Body);
2450
SqlExpression
pred = null;
2459
SqlExpression
itemExpression = this.VisitExpression(item);
2470
SqlExpression
exp = this.GetIdentityExpression(id, false);
2482
SqlExpression
proj = this.VisitExpression(rs.Body);
2517
private
SqlExpression
GetIdentityExpression(MetaDataMember id, bool isOutputFromInsert) {
2547
private
SqlExpression
GetRowCountExpression() {
2669
internal override
SqlExpression
VisitMethodCall(SqlMethodCall mc) {
2671
var
r = mc.Arguments[1];
2682
private
SqlExpression
VisitNewArrayInit(NewArrayExpression arr) {
2683
SqlExpression
[] exprs = new
SqlExpression
[arr.Expressions.Count];
2690
private
SqlExpression
VisitListInit(ListInitExpression list) {
2696
SqlExpression
[] exprs = new
SqlExpression
[list.Initializers.Count];
2813
internal override
SqlExpression
VisitNew(SqlNew sox) {
2821
foreach (
SqlExpression
expr in sox.Args) {
2831
SqlExpression
expr = ma.Expression;
2866
private static bool IsColumnMatch(MemberInfo column,
SqlExpression
expr) {
SqlClient\Query\SimpleExpression.cs (1)
19
internal static bool IsSimple(
SqlExpression
expr) {
SqlClient\Query\SqlAggregateChecker.cs (2)
27
internal override
SqlExpression
VisitSubSelect(SqlSubSelect ss) {
33
internal override
SqlExpression
VisitUnaryOperator(SqlUnary uo) {
SqlClient\Query\SqlAliaser.cs (1)
44
internal override
SqlExpression
VisitTableValuedFunctionCall(SqlTableValuedFunctionCall fc) {
SqlClient\Query\SqlAliasesReferenced.cs (2)
45
internal override
SqlExpression
VisitColumn(SqlColumn col) {
51
internal override
SqlExpression
VisitColumnRef(SqlColumnRef cref) {
SqlClient\Query\SqlBinder.cs (115)
50
Dictionary<object,
SqlExpression
> map;
56
internal void Add(object linkId,
SqlExpression
expr) {
58
this.map = new Dictionary<object,
SqlExpression
>();
62
internal bool TryGetValue(object linkId, out
SqlExpression
expr) {
120
internal override
SqlExpression
VisitExpression(
SqlExpression
expr) {
139
internal
SqlExpression
FetchExpression(
SqlExpression
expr) {
143
internal override
SqlExpression
VisitFunctionCall(SqlFunctionCall fc) {
150
internal override
SqlExpression
VisitLike(SqlLike like) {
156
internal override
SqlExpression
VisitGrouping(SqlGrouping g) {
162
internal override
SqlExpression
VisitMethodCall(SqlMethodCall mc) {
172
internal override
SqlExpression
VisitBinaryOperator(SqlBinary bo) {
292
SqlExpression
translated = this.translator.TranslateLinkEquals(bo);
308
SqlExpression
translated = this.translator.TranslateEquals(bo);
316
SqlExpression
left = TypeSource.GetTypeSource(bo.Left);
317
SqlExpression
right = TypeSource.GetTypeSource(bo.Right);
370
private MetaType[] GetPossibleTypes(
SqlExpression
typeExpression) {
402
internal override
SqlExpression
VisitDiscriminatorOf(SqlDiscriminatorOf dof) {
403
SqlExpression
obj = this.FetchExpression(dof.Object); // FetchExpression removes Link.
423
List<
SqlExpression
> matches = new List<
SqlExpression
>();
424
List<
SqlExpression
> values = new List<
SqlExpression
>();
430
SqlExpression
@default = sql.Value(discriminator.GetType(), tc.Whens[0].Match.SqlType, defaultType.InheritanceCode, true, tc.SourceExpression);
448
internal override
SqlExpression
VisitSearchedCase(SqlSearchedCase c) {
465
private bool IsConstNull(
SqlExpression
sqlExpr) {
478
private
SqlExpression
ApplyTreat(
SqlExpression
target, Type type) {
499
when.TypeBinding = (
SqlExpression
)ApplyTreat(when.TypeBinding, type);
513
SqlExpression
expr = target as
SqlExpression
;
526
internal override
SqlExpression
VisitTreat(SqlUnary a) {
532
internal override
SqlExpression
VisitUnaryOperator(SqlUnary uo) {
540
SqlExpression
translated = this.translator.TranslateLinkIsNull(uo);
598
SqlExpression
exp = uo.Operand;
624
List<
SqlExpression
> matches = new List<
SqlExpression
>();
625
List<
SqlExpression
> values = new List<
SqlExpression
>();
635
List<
SqlExpression
> newMatches = new List<
SqlExpression
>();
636
List<
SqlExpression
> newValues = new List<
SqlExpression
>();
639
SqlExpression
expr = VisitUnaryOperator(un);
661
internal override
SqlExpression
VisitNew(SqlNew sox) {
703
private SqlNode AccessMember(SqlMember m,
SqlExpression
expo) {
704
SqlExpression
exp = expo;
711
List<
SqlExpression
> matches = new List<
SqlExpression
>();
712
List<
SqlExpression
> values = new List<
SqlExpression
>();
714
SqlExpression
newValue = (
SqlExpression
)AccessMember(m, when.Value);
725
SqlExpression
result = sql.Case(newClrType, sc.Expression, matches, values, sc.SourceExpression);
732
List<
SqlExpression
> newMatches = new List<
SqlExpression
>();
733
List<
SqlExpression
> newValues = new List<
SqlExpression
>();
735
SqlExpression
newValue = (
SqlExpression
)AccessMember(m, when.Value);
745
SqlExpression
result = sql.Case(newClrType, sc.Expression, newMatches, newValues, sc.SourceExpression);
753
SqlExpression
value = (
SqlExpression
)AccessMember(m, when.Value);
756
SqlExpression
@else = (
SqlExpression
)AccessMember(m, sc.Else);
818
SqlExpression
e = n as
SqlExpression
;
844
SqlExpression
e = sn.Find(m.Member);
867
SqlExpression
rexp = result as
SqlExpression
;
956
private
SqlExpression
FoldSubquery(SqlSubSelect ss) {
1010
internal
SqlExpression
ExpandExpression(
SqlExpression
expression) {
1011
SqlExpression
expanded = this.expander.Expand(expression);
1018
internal override
SqlExpression
VisitAliasRef(SqlAliasRef aref) {
1063
internal override
SqlExpression
VisitSharedExpressionRef(SqlSharedExpressionRef sref) {
1065
return (
SqlExpression
) SqlDuplicator.Copy(sref.SharedExpression.Expression);
1068
internal override
SqlExpression
VisitSharedExpression(SqlSharedExpression shared) {
1081
internal override
SqlExpression
VisitSimpleExpression(SqlSimpleExpression simple) {
1086
SqlExpression
result = this.PushDownExpression(simple.Expression);
1093
private
SqlExpression
PushDownExpression(
SqlExpression
expr) {
1194
internal override
SqlExpression
VisitSubSelect(SqlSubSelect ss) {
1212
private
SqlExpression
ConvertLinks(
SqlExpression
node) {
1225
SqlExpression
o = ((SqlUnary)node).Operand;
1226
SqlExpression
e = this.ConvertLinks(o);
1240
SqlExpression
converted = ConvertLinks(when.Value);
1253
internal
SqlExpression
ConvertToExpression(SqlNode node) {
1257
SqlExpression
x = node as
SqlExpression
;
1272
internal
SqlExpression
ConvertToFetchedExpression(SqlNode node) {
1278
SqlExpression
o = ((SqlUnary)node).Operand;
1279
SqlExpression
e = this.ConvertLinks(o);
1281
return (
SqlExpression
)node;
1292
allExprs = allExprs && (fetchedValue is
SqlExpression
);
1298
List<
SqlExpression
> matches = new List<
SqlExpression
>();
1299
List<
SqlExpression
> values = new List<
SqlExpression
>();
1301
SqlExpression
fetchedValue = (
SqlExpression
)fetchedValues[i];
1324
SqlExpression
fetchedValue = (
SqlExpression
)fetchedValues[i];
1345
SqlExpression
cached;
1375
SqlExpression
where = ss.Select.Where;
1384
SqlExpression
result = new SqlAliasRef(sa);
1391
return (
SqlExpression
)node;
1395
private bool IsOuterDependent(SqlSource location, SqlAlias alias,
SqlExpression
where)
1457
SqlExpression
expr = node as
SqlExpression
;
1547
private
SqlExpression
VisitLinkExpansion(SqlLink link) {
1582
SqlExpression
elseFilter = null;
1585
SqlExpression
discriminatorPredicate = sql.Binary(SqlNodeType.EQ, clientCase.Expression, clientCase.Whens[i].Match);
SqlClient\Query\SqlBooleanizer.cs (7)
33
internal override
SqlExpression
ConvertValueToPredicate(
SqlExpression
valueExpression) {
47
internal override
SqlExpression
ConvertPredicateToValue(
SqlExpression
predicateExpression) {
58
SqlExpression
valueTrue = sql.ValueFromObject(true, false, predicateExpression.SourceExpression);
59
SqlExpression
valueFalse = sql.ValueFromObject(false, false, predicateExpression.SourceExpression);
61
SqlExpression
valueNull = sql.Value(valueTrue.ClrType, valueTrue.SqlType, null, false, predicateExpression.SourceExpression);
SqlClient\Query\SqlBooleanMismatchVisitor.cs (15)
21
internal abstract
SqlExpression
ConvertValueToPredicate(
SqlExpression
valueExpression);
22
internal abstract
SqlExpression
ConvertPredicateToValue(
SqlExpression
predicateExpression);
50
internal override
SqlExpression
VisitUnaryOperator(SqlUnary uo) {
59
internal override
SqlExpression
VisitBinaryOperator(SqlBinary bo) {
78
internal override
SqlExpression
VisitSearchedCase(SqlSearchedCase c) {
88
internal override
SqlExpression
VisitLift(SqlLift lift) {
97
internal
SqlExpression
VisitPredicate(
SqlExpression
exp) {
98
exp = (
SqlExpression
)base.Visit(exp);
111
internal override
SqlExpression
VisitExpression(
SqlExpression
exp) {
112
exp = (
SqlExpression
)base.Visit(exp);
122
private static bool IsPredicateExpression(
SqlExpression
exp) {
SqlClient\Query\SqlCaseSimplifier.cs (17)
36
internal override
SqlExpression
VisitBinaryOperator(SqlBinary bo) {
72
private
SqlExpression
DistributeOperatorIntoCase(SqlNodeType nt, SqlSimpleCase sc,
SqlExpression
expr) {
76
List<
SqlExpression
> values = new List<
SqlExpression
>();
77
List<
SqlExpression
> matches = new List<
SqlExpression
>();
87
internal override
SqlExpression
VisitSimpleCase(SqlSimpleCase c) {
119
SqlExpression
rewrite = TryToConsolidateAllValueExpressions(newWhens.Count, c.Whens[compareWhen].Value);
146
private
SqlExpression
TryToConsolidateAllValueExpressions(int valueCount,
SqlExpression
value) {
175
private
SqlExpression
TryToWriteAsSimpleBooleanExpression(Type caseType,
SqlExpression
discriminator, List<SqlWhen> newWhens, bool allValuesLiteral) {
176
SqlExpression
rewrite = null;
225
private
SqlExpression
TryToWriteAsReducedCase(Type caseType,
SqlExpression
discriminator, List<SqlWhen> newWhens,
SqlExpression
elseCandidate, int originalWhenCount) {
SqlClient\Query\SqlColumnizer.cs (22)
26
internal
SqlExpression
ColumnizeSelection(
SqlExpression
selection) {
30
internal static bool CanBeColumn(
SqlExpression
expression) {
35
HashSet<
SqlExpression
> candidates;
40
internal
SqlExpression
Declare(
SqlExpression
expression, HashSet<
SqlExpression
> candidates) {
42
return (
SqlExpression
)this.Visit(expression);
46
SqlExpression
expr = node as
SqlExpression
;
64
HashSet<
SqlExpression
> candidates;
66
internal HashSet<
SqlExpression
> Nominate(
SqlExpression
expression) {
67
this.candidates = new HashSet<
SqlExpression
>();
74
SqlExpression
expression = node as
SqlExpression
;
94
internal override
SqlExpression
VisitSimpleCase(SqlSimpleCase c) {
103
internal override
SqlExpression
VisitTypeCase(SqlTypeCase tc) {
112
internal override
SqlExpression
VisitClientCase(SqlClientCase c) {
121
private static bool CanRecurseColumnize(
SqlExpression
expr) {
143
private static bool IsClientOnly(
SqlExpression
expr) {
167
internal static bool CanBeColumn(
SqlExpression
expression) {
SqlClient\Query\SqlComparer.cs (2)
289
private static
SqlExpression
UnwrapTrivialCaseExpression(SqlSimpleCase sc) {
296
SqlExpression
result = sc.Whens[0].Value;
SqlClient\Query\SqlDeflator.cs (14)
47
internal override
SqlExpression
VisitSubSelect(SqlSubSelect ss) {
58
internal override
SqlExpression
VisitColumnRef(SqlColumnRef cref) {
59
SqlExpression
literal = this.GetLiteralValue(cref);
66
private SqlValue GetLiteralValue(
SqlExpression
expr) {
88
internal override
SqlExpression
VisitColumnRef(SqlColumnRef cref) {
93
internal override
SqlExpression
VisitScalarSubSelect(SqlSubSelect ss) {
107
internal override
SqlExpression
VisitExists(SqlSubSelect ss) {
206
internal bool AreEquivalent(
SqlExpression
e1,
SqlExpression
e2) {
240
private void CheckJoinCondition(
SqlExpression
expr) {
264
internal override
SqlExpression
VisitSubSelect(SqlSubSelect ss) {
277
internal override
SqlExpression
VisitAliasRef(SqlAliasRef aref) {
286
internal override
SqlExpression
VisitColumnRef(SqlColumnRef cref) {
493
internal override
SqlExpression
VisitColumnRef(SqlColumnRef cref) {
SqlClient\Query\SqlDuplicator.cs (90)
60
internal override
SqlExpression
VisitDoNotVisit(SqlDoNotVisitExpression expr) {
71
internal override
SqlExpression
VisitAliasRef(SqlAliasRef aref) {
81
orderBy.Add(new SqlOrderExpression(expr.OrderType, (
SqlExpression
)this.Visit(expr.Expression)));
86
internal override
SqlExpression
VisitBinaryOperator(SqlBinary bo) {
87
SqlExpression
left = (
SqlExpression
)this.Visit(bo.Left);
88
SqlExpression
right = (
SqlExpression
)this.Visit(bo.Right);
91
internal override
SqlExpression
VisitClientQuery(SqlClientQuery cq) {
102
internal override
SqlExpression
VisitJoinedCollection(SqlJoinedCollection jc) {
105
internal override
SqlExpression
VisitClientArray(SqlClientArray scar) {
106
SqlExpression
[] exprs = new
SqlExpression
[scar.Expressions.Count];
112
internal override
SqlExpression
VisitTypeCase(SqlTypeCase tc) {
113
SqlExpression
disc = VisitExpression(tc.Discriminator);
120
internal override
SqlExpression
VisitNew(SqlNew sox) {
121
SqlExpression
[] args = new
SqlExpression
[sox.Args.Count];
132
SqlExpression
[] exprs = new
SqlExpression
[link.KeyExpressions.Count];
143
internal override
SqlExpression
VisitColumn(SqlColumn col) {
150
internal override
SqlExpression
VisitColumnRef(SqlColumnRef cref) {
159
internal override
SqlExpression
VisitElement(SqlSubSelect elem) {
162
internal override
SqlExpression
VisitExists(SqlSubSelect sqlExpr) {
175
SqlExpression
cond = (
SqlExpression
)this.Visit(join.Condition);
178
internal override
SqlExpression
VisitValue(SqlValue value) {
182
return new SqlMember(m.ClrType, m.SqlType, (
SqlExpression
)this.Visit(m.Expression), m.Member);
185
return new SqlMemberAssign(ma.Member, (
SqlExpression
)this.Visit(ma.Expression));
187
internal override
SqlExpression
VisitMultiset(SqlSubSelect sms) {
190
internal override
SqlExpression
VisitParameter(SqlParameter p) {
202
internal override
SqlExpression
VisitScalarSubSelect(SqlSubSelect ss) {
207
List<
SqlExpression
> gex = null;
209
gex = new List<
SqlExpression
>(select.GroupBy.Count);
210
foreach (
SqlExpression
sqlExpr in select.GroupBy) {
211
gex.Add((
SqlExpression
)this.Visit(sqlExpr));
214
SqlExpression
having = (
SqlExpression
)this.Visit(select.Having);
219
SqlOrderExpression nsox = new SqlOrderExpression(sox.OrderType, (
SqlExpression
)this.Visit(sox.Expression));
223
SqlExpression
top = (
SqlExpression
)this.Visit(select.Top);
224
SqlExpression
where = (
SqlExpression
)this.Visit(select.Where);
226
SqlExpression
selection = this.VisitExpression(select.Selection);
252
List<
SqlExpression
> args = new List<
SqlExpression
>(suq.Arguments.Count);
253
foreach (
SqlExpression
expr in suq.Arguments) {
256
SqlExpression
projection = this.VisitExpression(suq.Projection);
269
List<
SqlExpression
> args = new List<
SqlExpression
>(spc.Arguments.Count);
270
foreach (
SqlExpression
expr in spc.Arguments) {
273
SqlExpression
projection = this.VisitExpression(spc.Projection);
281
internal override
SqlExpression
VisitUserColumn(SqlUserColumn suc) {
287
internal override
SqlExpression
VisitUserRow(SqlUserRow row) {
290
internal override
SqlExpression
VisitTreat(SqlUnary t) {
291
return new SqlUnary(SqlNodeType.Treat, t.ClrType, t.SqlType, (
SqlExpression
)this.Visit(t.Operand), t.SourceExpression);
293
internal override
SqlExpression
VisitUnaryOperator(SqlUnary uo) {
294
return new SqlUnary(uo.NodeType, uo.ClrType, uo.SqlType, (
SqlExpression
)this.Visit(uo.Operand), uo.Method, uo.SourceExpression);
307
internal override
SqlExpression
VisitSearchedCase(SqlSearchedCase c) {
308
SqlExpression
@else = this.VisitExpression(c.Else);
316
internal override
SqlExpression
VisitClientCase(SqlClientCase c) {
317
SqlExpression
expr = this.VisitExpression(c.Expression);
325
internal override
SqlExpression
VisitSimpleCase(SqlSimpleCase c) {
326
SqlExpression
expr = this.VisitExpression(c.Expression);
337
internal override
SqlExpression
VisitExprSet(SqlExprSet xs) {
338
SqlExpression
[] exprs = new
SqlExpression
[xs.Expressions.Count];
351
internal override
SqlExpression
VisitVariable(SqlVariable v) {
354
internal override
SqlExpression
VisitOptionalValue(SqlOptionalValue sov) {
355
SqlExpression
hasValue = this.VisitExpression(sov.HasValue);
356
SqlExpression
value = this.VisitExpression(sov.Value);
359
internal override
SqlExpression
VisitBetween(SqlBetween between) {
370
internal override
SqlExpression
VisitIn(SqlIn sin) {
377
internal override
SqlExpression
VisitLike(SqlLike like) {
386
internal override
SqlExpression
VisitFunctionCall(SqlFunctionCall fc) {
387
SqlExpression
[] args = new
SqlExpression
[fc.Arguments.Count];
393
internal override
SqlExpression
VisitTableValuedFunctionCall(SqlTableValuedFunctionCall fc) {
394
SqlExpression
[] args = new
SqlExpression
[fc.Arguments.Count];
405
internal override
SqlExpression
VisitMethodCall(SqlMethodCall mc) {
406
SqlExpression
[] args = new
SqlExpression
[mc.Arguments.Count];
412
internal override
SqlExpression
VisitSharedExpression(SqlSharedExpression sub) {
418
internal override
SqlExpression
VisitSharedExpressionRef(SqlSharedExpressionRef sref) {
424
internal override
SqlExpression
VisitSimpleExpression(SqlSimpleExpression simple) {
428
internal override
SqlExpression
VisitGrouping(SqlGrouping g) {
434
internal override
SqlExpression
VisitDiscriminatedType(SqlDiscriminatedType dt) {
437
internal override
SqlExpression
VisitLift(SqlLift lift) {
440
internal override
SqlExpression
VisitDiscriminatorOf(SqlDiscriminatorOf dof) {
SqlClient\Query\SqlExpander.cs (60)
24
internal
SqlExpression
Expand(
SqlExpression
exp) {
38
internal override
SqlExpression
VisitColumnRef(SqlColumnRef cref) {
42
internal override
SqlExpression
VisitColumn(SqlColumn col) {
46
internal override
SqlExpression
VisitSharedExpression(SqlSharedExpression shared) {
50
internal override
SqlExpression
VisitSharedExpressionRef(SqlSharedExpressionRef sref) {
54
internal override
SqlExpression
VisitAliasRef(SqlAliasRef aref) {
67
SqlExpression
exp = node as
SqlExpression
;
73
internal override
SqlExpression
VisitSubSelect(SqlSubSelect ss) {
74
return (
SqlExpression
)new SqlDuplicator().Duplicate(ss);
78
SqlExpression
expansion = this.VisitExpression(link.Expansion);
79
SqlExpression
[] exprs = new
SqlExpression
[link.KeyExpressions.Count];
86
private
SqlExpression
ExpandUnion(SqlUnion union) {
87
List<
SqlExpression
> exprs = new List<
SqlExpression
>(2);
90
SqlExpression
result = this.ExpandTogether(exprs);
94
private void GatherUnionExpressions(SqlNode node, List<
SqlExpression
> exprs) {
117
private
SqlExpression
ExpandTogether(List<
SqlExpression
> exprs) {
125
List<
SqlExpression
> expandedArgs = new List<
SqlExpression
>();
128
List<
SqlExpression
> args = new List<
SqlExpression
>();
132
SqlExpression
expanded = this.ExpandTogether(args);
146
List<
SqlExpression
> expressions = new List<
SqlExpression
>();
150
SqlExpression
expression = this.ExpandTogether(expressions);
155
List<
SqlExpression
> scos = new List<
SqlExpression
>();
174
List<
SqlExpression
> discriminators = new List<
SqlExpression
>();
178
SqlExpression
discriminator = this.ExpandTogether(discriminators);
186
List<
SqlExpression
> scos = new List<
SqlExpression
>();
191
SqlExpression
expanded = this.ExpandTogether(scos);
215
List<
SqlExpression
> mexprs = new List<
SqlExpression
>();
224
SqlExpression
[] arguments = new
SqlExpression
[cobs[0].Args.Count];
226
List<
SqlExpression
> mexprs = new List<
SqlExpression
>();
246
SqlExpression
[] kexprs = new
SqlExpression
[links[0].KeyExpressions.Count];
247
List<
SqlExpression
> lexprs = new List<
SqlExpression
>();
258
SqlExpression
expansion = null;
287
List<
SqlExpression
> hvals = new List<
SqlExpression
>(exprs.Count);
288
List<
SqlExpression
> vals = new List<
SqlExpression
>(exprs.Count);
303
List<
SqlExpression
> values = new List<
SqlExpression
>(exprs.Count);
315
List<
SqlExpression
> foos = new List<
SqlExpression
>(exprs.Count);
340
private
SqlExpression
ExpandIntoExprSet(List<
SqlExpression
> exprs) {
341
SqlExpression
[] rexprs = new
SqlExpression
[exprs.Count];
SqlClient\Query\SqlExpressionNullability.cs (3)
23
internal static bool? CanBeNull(
SqlExpression
expr) {
99
private static bool? CanBeNull(IEnumerable<
SqlExpression
> exprs) {
101
foreach(
SqlExpression
e in exprs) {
SqlClient\Query\SqlFlattener.cs (18)
36
internal override
SqlExpression
VisitColumnRef(SqlColumnRef cref) {
81
private
SqlExpression
FlattenSelection(SqlRow row, bool isInput,
SqlExpression
selection) {
98
internal override
SqlExpression
VisitNew(SqlNew sox) {
103
internal override
SqlExpression
VisitColumn(SqlColumn col) {
122
internal override
SqlExpression
VisitColumnRef(SqlColumnRef cref) {
133
internal override
SqlExpression
VisitSubSelect(SqlSubSelect ss) {
137
internal override
SqlExpression
VisitClientQuery(SqlClientQuery cq) {
141
private SqlColumnRef MakeFlattenedColumn(
SqlExpression
expr, string name) {
160
private SqlColumn FindColumnWithExpression(IEnumerable<SqlColumn> columns,
SqlExpression
expr) {
173
private void FlattenGroupBy(List<
SqlExpression
> exprs) {
174
List<
SqlExpression
> list = new List<
SqlExpression
>(exprs.Count);
175
foreach (
SqlExpression
gex in exprs) {
185
private void FlattenGroupByExpression(List<
SqlExpression
> exprs,
SqlExpression
expr) {
191
foreach (
SqlExpression
arg in sn.Args) {
208
foreach (
SqlExpression
key in link.KeyExpressions) {
SqlClient\Query\SqlFormatter.cs (46)
113
internal override
SqlExpression
VisitNop(SqlNop nop) {
122
internal override
SqlExpression
VisitUnaryOperator(SqlUnary uo) {
202
internal override
SqlExpression
VisitLift(SqlLift lift) {
207
internal override
SqlExpression
VisitBinaryOperator(SqlBinary bo) {
227
internal override
SqlExpression
VisitBetween(SqlBetween between) {
236
internal override
SqlExpression
VisitIn(SqlIn sin) {
249
internal override
SqlExpression
VisitLike(SqlLike like) {
260
internal override
SqlExpression
VisitFunctionCall(SqlFunctionCall fc) {
279
internal override
SqlExpression
VisitTableValuedFunctionCall(SqlTableValuedFunctionCall fc) {
284
internal override
SqlExpression
VisitCast(SqlUnary c) {
297
internal override
SqlExpression
VisitTreat(SqlUnary t) {
306
internal override
SqlExpression
VisitColumn(SqlColumn c) {
334
internal override
SqlExpression
VisitDiscriminatedType(SqlDiscriminatedType dt) {
345
internal override
SqlExpression
VisitDiscriminatorOf(SqlDiscriminatorOf dof) {
356
internal override
SqlExpression
VisitSimpleExpression(SqlSimpleExpression simple) {
366
internal override
SqlExpression
VisitSharedExpression(SqlSharedExpression shared) {
376
internal override
SqlExpression
VisitSharedExpressionRef(SqlSharedExpressionRef sref) {
386
internal override
SqlExpression
VisitColumnRef(SqlColumnRef cref) {
432
internal override
SqlExpression
VisitParameter(SqlParameter p) {
437
internal override
SqlExpression
VisitValue(SqlValue value) {
447
internal override
SqlExpression
VisitClientParameter(SqlClientParameter cp) {
466
internal override
SqlExpression
VisitScalarSubSelect(SqlSubSelect ss) {
481
internal override
SqlExpression
VisitElement(SqlSubSelect elem) {
496
internal override
SqlExpression
VisitMultiset(SqlSubSelect sms) {
511
internal override
SqlExpression
VisitExists(SqlSubSelect sqlExpr) {
549
internal override
SqlExpression
VisitUserColumn(SqlUserColumn suc) {
618
internal override
SqlExpression
VisitAliasRef(SqlAliasRef aref) {
658
internal override
SqlExpression
VisitExprSet(SqlExprSet xs) {
698
internal override
SqlExpression
VisitNew(SqlNew sox) {
708
SqlExpression
argExpr = sox.Args[i];
729
internal override
SqlExpression
VisitClientArray(SqlClientArray scar) {
818
SqlExpression
exp = ss.GroupBy[i];
947
internal override
SqlExpression
VisitClientQuery(SqlClientQuery cq) {
962
internal override
SqlExpression
VisitJoinedCollection(SqlJoinedCollection jc) {
1088
internal override
SqlExpression
VisitSearchedCase(SqlSearchedCase c) {
1113
internal override
SqlExpression
VisitSimpleCase(SqlSimpleCase c) {
1143
internal override
SqlExpression
VisitClientCase(SqlClientCase c) {
1176
internal override
SqlExpression
VisitTypeCase(SqlTypeCase c) {
1209
internal override
SqlExpression
VisitVariable(SqlVariable v) {
1214
private string InferName(
SqlExpression
exp, string def) {
1380
internal override
SqlExpression
VisitMethodCall(SqlMethodCall mc) {
1400
internal override
SqlExpression
VisitOptionalValue(SqlOptionalValue sov) {
1413
internal override
SqlExpression
VisitUserRow(SqlUserRow row) {
1420
internal override
SqlExpression
VisitGrouping(SqlGrouping g) {
1449
internal override
SqlExpression
VisitColumn(SqlColumn col) {
1469
internal override
SqlExpression
VisitTableValuedFunctionCall(SqlTableValuedFunctionCall fc) {
SqlClient\Query\SqlGatherConsumedAliases.cs (2)
22
internal override
SqlExpression
VisitColumn(SqlColumn col) {
27
internal override
SqlExpression
VisitColumnRef(SqlColumnRef cref) {
SqlClient\Query\SqlLiftIndependentRowExpressions.cs (1)
77
internal override
SqlExpression
VisitColumnRef(SqlColumnRef cref) {
SqlClient\Query\SqlLiftWhereClauses.cs (6)
20
internal
SqlExpression
Where;
21
internal Scope(
SqlExpression
where, Scope parent) {
98
internal override
SqlExpression
VisitSubSelect(SqlSubSelect ss) {
102
SqlExpression
result = base.VisitSubSelect(ss);
106
internal override
SqlExpression
VisitClientQuery(SqlClientQuery cq) {
110
SqlExpression
result = base.VisitClientQuery(cq);
SqlClient\Query\SqlMethodCallConverter.cs (419)
617
internal override
SqlExpression
VisitColumn(SqlColumn col) {
621
internal override
SqlExpression
VisitSubSelect(SqlSubSelect ss) {
625
internal override
SqlExpression
VisitClientQuery(SqlClientQuery cq) {
650
internal override
SqlExpression
VisitUnaryOperator(SqlUnary uo) {
653
SqlExpression
expr = uo.Operand;
663
internal override
SqlExpression
VisitBinaryOperator(SqlBinary bo) {
674
internal override
SqlExpression
VisitTypeCase(SqlTypeCase tc) {
676
List<
SqlExpression
> matches = new List<
SqlExpression
>();
677
List<
SqlExpression
> values = new List<
SqlExpression
>();
680
SqlExpression
newMatch = this.VisitExpression(when.Match);
681
SqlExpression
newNew = this.VisitExpression(when.TypeBinding);
700
internal override
SqlExpression
VisitNew(SqlNew sox) {
717
private
SqlExpression
TranslateNewString(SqlNew sox) {
722
return sql.FunctionCall(typeof(string), "REPLICATE", new
SqlExpression
[] { sox.Args[0], sox.Args[1] }, sox.SourceExpression);
727
private
SqlExpression
TranslateNewDateTime(SqlNew sox) {
734
SqlExpression
char2 = sql.FunctionCall(typeof(void), "NCHAR", new
SqlExpression
[1] { sql.ValueFromObject(2, false, source) }, source);
735
SqlExpression
char4 = sql.FunctionCall(typeof(void), "NCHAR", new
SqlExpression
[1] { sql.ValueFromObject(4, false, source) }, source);
736
SqlExpression
year = sql.FunctionCall(typeof(string), "CONVERT", new
SqlExpression
[2] { char4, sox.Args[0] }, source);
737
SqlExpression
month = sql.FunctionCall(typeof(string), "CONVERT", new
SqlExpression
[2] { char2, sox.Args[1] }, source);
738
SqlExpression
day = sql.FunctionCall(typeof(string), "CONVERT", new
SqlExpression
[2] { char2, sox.Args[2] }, source);
739
SqlExpression
datetime = new SqlVariable(typeof(void), null, "DATETIME", source);
741
SqlExpression
date = sql.Concat(month, sql.ValueFromObject("/", false, source), day, sql.ValueFromObject("/", false, source), year);
742
return sql.FunctionCall(typeof(DateTime), "CONVERT", new
SqlExpression
[3] { datetime, date, sql.ValueFromObject(101, false, source) }, source);
749
SqlExpression
hour = sql.FunctionCall(typeof(string), "CONVERT", new
SqlExpression
[2] { char2, sox.Args[3] }, source);
750
SqlExpression
minute = sql.FunctionCall(typeof(string), "CONVERT", new
SqlExpression
[2] { char2, sox.Args[4] }, source);
751
SqlExpression
second = sql.FunctionCall(typeof(string), "CONVERT", new
SqlExpression
[2] { char2, sox.Args[5] }, source);
752
SqlExpression
date = sql.Concat(year, sql.ValueFromObject("-", false, source), month, sql.ValueFromObject("-", false, source), day);
753
SqlExpression
time = sql.Concat(hour, sql.ValueFromObject(":", false, source), minute, sql.ValueFromObject(":", false, source), second);
754
SqlExpression
dateAndTime = sql.Concat(date, sql.ValueFromObject(' ', false, source), time);
756
return sql.FunctionCall(typeof(DateTime), "CONVERT", new
SqlExpression
[3] { datetime, dateAndTime, sql.ValueFromObject(120, false, source) }, source);
761
SqlExpression
msRaw = sql.FunctionCall(typeof(string), "CONVERT", new
SqlExpression
[2] {char4,
763
SqlExpression
ms;
766
SqlExpression
len = sql.FunctionCall(typeof(int), "LEN", new
SqlExpression
[1] { msRaw }, source);
767
SqlExpression
startIndex = sql.Binary(SqlNodeType.Sub, len, sql.ValueFromObject(2, false, source));
768
ms = sql.FunctionCall(typeof(string), "SUBSTRING", new
SqlExpression
[3] { msRaw, startIndex, sql.ValueFromObject(3, false, source) }, source);
771
ms = sql.FunctionCall(typeof(string), "RIGHT", new
SqlExpression
[2] { msRaw, sql.ValueFromObject(3, false, source) }, source);
774
return sql.FunctionCall(typeof(DateTime), "CONVERT", new
SqlExpression
[3] { datetime, dateAndTime, sql.ValueFromObject(121, false, source) }, source);
781
private
SqlExpression
TranslateNewDateTimeOffset(SqlNew sox) {
788
new
SqlExpression
[2] { sox.Args[0], sql.ValueFromObject(0, false, source) },
795
new
SqlExpression
[2]
808
SqlExpression
char2 = sql.FunctionCall(typeof(void), "NCHAR", new
SqlExpression
[1] { sql.ValueFromObject(2, false, source) }, source);
809
SqlExpression
char4 = sql.FunctionCall(typeof(void), "NCHAR", new
SqlExpression
[1] { sql.ValueFromObject(4, false, source) }, source);
810
SqlExpression
char5 = sql.FunctionCall(typeof(void), "NCHAR", new
SqlExpression
[1] { sql.ValueFromObject(5, false, source) }, source);
813
SqlExpression
yyRaw = sql.FunctionCall(typeof(string), "CONVERT", new
SqlExpression
[2] {char5,
815
SqlExpression
year = sql.FunctionCall(typeof(string), "RIGHT", new
SqlExpression
[2] { yyRaw, sql.ValueFromObject(4, false, source) }, source);
817
SqlExpression
month = sql.FunctionCall(typeof(string), "CONVERT", new
SqlExpression
[2] { char2, sox.Args[1] }, source);
818
SqlExpression
day = sql.FunctionCall(typeof(string), "CONVERT", new
SqlExpression
[2] { char2, sox.Args[2] }, source);
820
SqlExpression
hour = sql.FunctionCall(typeof(string), "CONVERT", new
SqlExpression
[2] { char2, sox.Args[3] }, source);
821
SqlExpression
minute = sql.FunctionCall(typeof(string), "CONVERT", new
SqlExpression
[2] { char2, sox.Args[4] }, source);
822
SqlExpression
second = sql.FunctionCall(typeof(string), "CONVERT", new
SqlExpression
[2] { char2, sox.Args[5] }, source);
823
SqlExpression
date = sql.Concat(year, sql.ValueFromObject("-", false, source), month, sql.ValueFromObject("-", false, source), day);
824
SqlExpression
time = sql.Concat(hour, sql.ValueFromObject(":", false, source), minute, sql.ValueFromObject(":", false, source), second);
826
SqlExpression
datetimeoffset = new SqlVariable(typeof(void), null, "DATETIMEOFFSET", source);
827
SqlExpression
result, dateAndTime;
833
result = sql.FunctionCall(typeof(DateTimeOffset), "CONVERT", new
SqlExpression
[3] { datetimeoffset, dateAndTime, sql.ValueFromObject(120, false, source) }, source);
838
SqlExpression
msRaw = sql.FunctionCall(typeof(string), "CONVERT", new
SqlExpression
[2] {char4,
840
SqlExpression
ms = sql.FunctionCall(typeof(string), "RIGHT", new
SqlExpression
[2] { msRaw, sql.ValueFromObject(3, false, source) }, source);
842
result = sql.FunctionCall(typeof(DateTimeOffset), "CONVERT", new
SqlExpression
[3] { datetimeoffset, dateAndTime, sql.ValueFromObject(121, false, source) }, source);
849
new
SqlExpression
[2]
860
private
SqlExpression
TranslateNewTimeSpan(SqlNew sox) {
866
SqlExpression
hours = sql.ConvertToBigint(sox.Args[0]);
867
SqlExpression
minutes = sql.ConvertToBigint(sox.Args[1]);
868
SqlExpression
seconds = sql.ConvertToBigint(sox.Args[2]);
869
SqlExpression
TicksFromHours = sql.Multiply(hours, TimeSpan.TicksPerHour);
870
SqlExpression
TicksFromMinutes = sql.Multiply(minutes, TimeSpan.TicksPerMinute);
871
SqlExpression
TicksFromSeconds = sql.Multiply(seconds, TimeSpan.TicksPerSecond);
875
SqlExpression
days = sql.ConvertToBigint(sox.Args[0]);
876
SqlExpression
hours = sql.ConvertToBigint(sox.Args[1]);
877
SqlExpression
minutes = sql.ConvertToBigint(sox.Args[2]);
878
SqlExpression
seconds = sql.ConvertToBigint(sox.Args[3]);
879
SqlExpression
TicksFromDays = sql.Multiply(days, TimeSpan.TicksPerDay);
880
SqlExpression
TicksFromHours = sql.Multiply(hours, TimeSpan.TicksPerHour);
881
SqlExpression
TicksFromMinutes = sql.Multiply(minutes, TimeSpan.TicksPerMinute);
882
SqlExpression
TicksFromSeconds = sql.Multiply(seconds, TimeSpan.TicksPerSecond);
883
SqlExpression
totalTicks = sql.Add(TicksFromDays, TicksFromHours, TicksFromMinutes, TicksFromSeconds);
890
SqlExpression
milliseconds = sql.ConvertToBigint(sox.Args[4]);
891
SqlExpression
ticksFromMs = sql.Multiply(milliseconds, TimeSpan.TicksPerMillisecond);
898
internal override
SqlExpression
VisitMethodCall(SqlMethodCall mc) {
901
SqlExpression
returnValue = null;
957
SqlExpression
expr = mc.Object;
997
private
SqlExpression
TranslateGetValueOrDefaultMethod(SqlMethodCall mc) {
1010
private
SqlExpression
TranslateSqlMethodsMethod(SqlMethodCall mc) {
1012
SqlExpression
returnValue = null;
1017
SqlExpression
start = mc.Arguments[0];
1018
SqlExpression
end = mc.Arguments[1];
1019
SqlExpression
unit = new SqlVariable(typeof(void), null, datePart, source);
1021
new
SqlExpression
[] { unit, start, end }, source);
1034
SqlExpression
length = sql.DATALENGTH(mc.Arguments[0]);
1041
private
SqlExpression
CreateComparison(
SqlExpression
a,
SqlExpression
b, Expression source) {
1042
SqlExpression
lower = sql.Binary(SqlNodeType.LT, a, b);
1043
SqlExpression
equal = sql.Binary(SqlNodeType.EQ2V, a, b);
1053
private
SqlExpression
TranslateDateTimeInstanceMethod(SqlMethodCall mc) {
1054
SqlExpression
returnValue = null;
1062
SqlExpression
sqlTicks = mc.Arguments[0];
1065
SqlExpression
ns = this.sql.DATEPART("NANOSECOND", mc.Arguments[0]);
1066
SqlExpression
ss = this.sql.DATEPART("SECOND", mc.Arguments[0]);
1067
SqlExpression
mm = this.sql.DATEPART("MINUTE", mc.Arguments[0]);
1068
SqlExpression
hh = this.sql.DATEPART("HOUR", mc.Arguments[0]);
1097
SqlExpression
ms = sql.Multiply(mc.Arguments[0], 1000);
1101
SqlExpression
ms = sql.Multiply(mc.Arguments[0], 60000);
1105
SqlExpression
ms = sql.Multiply(mc.Arguments[0], 3600000);
1109
SqlExpression
ms = sql.Multiply(mc.Arguments[0], 86400000);
1115
private
SqlExpression
TranslateDateTimeOffsetInstanceMethod(SqlMethodCall mc) {
1116
SqlExpression
returnValue = null;
1123
SqlExpression
ns = sql.DATEPART("NANOSECOND", mc.Arguments[0]);
1124
SqlExpression
ss = sql.DATEPART("SECOND", mc.Arguments[0]);
1125
SqlExpression
mi = sql.DATEPART("MINUTE", mc.Arguments[0]);
1126
SqlExpression
hh = sql.DATEPART("HOUR", mc.Arguments[0]);
1128
SqlExpression
ticks = sql.Add(
1156
SqlExpression
ms = sql.Multiply(mc.Arguments[0], 1000);
1160
SqlExpression
ms = sql.Multiply(mc.Arguments[0], 60000);
1164
SqlExpression
ms = sql.Multiply(mc.Arguments[0], 3600000);
1168
SqlExpression
ms = sql.Multiply(mc.Arguments[0], 86400000);
1174
private
SqlExpression
TranslateTimeSpanInstanceMethod(SqlMethodCall mc) {
1175
SqlExpression
returnValue = null;
1190
returnValue = sql.FunctionCall(typeof(TimeSpan), "ABS", new
SqlExpression
[] { mc.Object }, source);
1198
private
SqlExpression
TranslateConvertStaticMethod(SqlMethodCall mc) {
1199
SqlExpression
returnValue = null;
1201
SqlExpression
expr = mc.Arguments[0];
1284
private
SqlExpression
TranslateDateTimeBinary(SqlBinary bo) {
1292
SqlExpression
end = bo.Left;
1293
SqlExpression
start = bo.Right;
1294
SqlExpression
day = new SqlVariable(typeof(void), null, "DAY", bo.SourceExpression);
1295
SqlExpression
ms = new SqlVariable(typeof(void), null, "MILLISECOND", bo.SourceExpression);
1299
SqlExpression
intDays = sql.FunctionCall(typeof(int), "DATEDIFF",
1300
new
SqlExpression
[] { day, start, end }, bo.SourceExpression);
1301
SqlExpression
startPlusDays = sql.FunctionCall(
1302
typeof(DateTime), "DATEADD", new
SqlExpression
[] { day, intDays, start }, bo.SourceExpression);
1303
SqlExpression
intMSec = sql.FunctionCall(typeof(int), "DATEDIFF",
1304
new
SqlExpression
[] { ms, startPlusDays, end }, bo.SourceExpression);
1305
SqlExpression
result = sql.Multiply(sql.Add(sql.Multiply(sql.ConvertToBigint(intDays), 86400000), intMSec), 10000); // 1 millisecond = 10000 ticks
1312
SqlExpression
end = bo.Left;
1313
SqlExpression
start = bo.Right;
1314
SqlExpression
day = new SqlVariable(typeof(void), null, "DAY", bo.SourceExpression);
1315
SqlExpression
ms = new SqlVariable(typeof(void), null, "MILLISECOND", bo.SourceExpression);
1316
SqlExpression
us = new SqlVariable(typeof(void), null, "MICROSECOND", bo.SourceExpression);
1317
SqlExpression
ns = new SqlVariable(typeof(void), null, "NANOSECOND", bo.SourceExpression);
1320
SqlExpression
intDays = sql.FunctionCall(typeof(int), "DATEDIFF", new
SqlExpression
[] { day, start, end }, bo.SourceExpression);
1321
SqlExpression
startPlusDays = sql.FunctionCall(typeof(DateTimeOffset), "DATEADD", new
SqlExpression
[] { day, intDays, start }, bo.SourceExpression);
1322
SqlExpression
intMSec = sql.FunctionCall(typeof(int), "DATEDIFF", new
SqlExpression
[] { ms, startPlusDays, end }, bo.SourceExpression);
1323
SqlExpression
startPlusDaysPlusMsec = sql.FunctionCall(typeof(DateTimeOffset), "DATEADD", new
SqlExpression
[] { ms, intMSec, startPlusDays }, bo.SourceExpression);
1324
SqlExpression
intUSec = sql.FunctionCall(typeof(int), "DATEDIFF", new
SqlExpression
[] { us, startPlusDaysPlusMsec, end }, bo.SourceExpression);
1325
SqlExpression
startPlusDaysPlusMsecPlusUSec = sql.FunctionCall(typeof(DateTimeOffset), "DATEADD", new
SqlExpression
[] { us, intUSec, startPlusDaysPlusMsec }, bo.SourceExpression);
1326
SqlExpression
intNSec = sql.FunctionCall(typeof(int), "DATEDIFF", new
SqlExpression
[] { ns, startPlusDaysPlusMsecPlusUSec, end }, bo.SourceExpression);
1327
SqlExpression
startPlusDaysPlusMsecPlusUSecPlusNSec = sql.FunctionCall(typeof(DateTimeOffset), "DATEADD", new
SqlExpression
[] { ns, intNSec, startPlusDaysPlusMsecPlusUSec }, bo.SourceExpression);
1329
SqlExpression
result = sql.Add(
1343
SqlExpression
right = bo.Right;
1345
SqlExpression
ns = sql.DATEPART("NANOSECOND", right);
1346
SqlExpression
ss = sql.DATEPART("SECOND", right);
1347
SqlExpression
mi = sql.DATEPART("MINUTE", right);
1348
SqlExpression
hh = sql.DATEPART("HOUR", right);
1391
internal
SqlExpression
TranslateDecimalMethod(SqlMethodCall mc) {
1419
new
SqlExpression
[] {
1428
new
SqlExpression
[] {
1444
private
SqlExpression
TranslateStringStaticMethod(SqlMethodCall mc) {
1445
SqlExpression
returnValue = null;
1450
List<
SqlExpression
> exprs = null;
1461
SqlExpression
sum;
1491
private
SqlExpression
CreateFunctionCallStatic1(Type type, string functionName, List<
SqlExpression
> arguments, Expression source) {
1492
return sql.FunctionCall(type, functionName, new
SqlExpression
[] { arguments[0] }, source);
1495
private
SqlExpression
CreateFunctionCallStatic2(Type type, string functionName, List<
SqlExpression
> arguments, Expression source) {
1496
return sql.FunctionCall(type, functionName, new
SqlExpression
[] { arguments[0], arguments[1] }, source);
1499
private
SqlExpression
TranslateStringMethod(SqlMethodCall mc) {
1505
SqlExpression
pattern = mc.Arguments[0];
1506
SqlExpression
escape = null;
1539
SqlExpression
pattern = mc.Arguments[0];
1540
SqlExpression
escape = null;
1573
SqlExpression
pattern = mc.Arguments[0];
1574
SqlExpression
escape = null;
1611
SqlExpression
lenZeroExpr = sql.Binary(SqlNodeType.EQ, sql.CLRLENGTH(mc.Arguments[0]), sql.ValueFromObject(0, source));
1613
SqlExpression
@else = sql.Subtract(sql.FunctionCall(typeof(int), "CHARINDEX",
1614
new
SqlExpression
[] {
1630
SqlExpression
lenZeroExpr = sql.Binary(SqlNodeType.EQ, sql.CLRLENGTH(mc.Arguments[0]), sql.ValueFromObject(0, source));
1633
SqlExpression
@else = sql.Subtract(sql.FunctionCall(typeof(int), "CHARINDEX",
1634
new
SqlExpression
[] {
1653
SqlExpression
lenZeroExpr = sql.Binary(SqlNodeType.EQ, sql.CLRLENGTH(mc.Arguments[0]), sql.ValueFromObject(0, source));
1656
SqlExpression
substring = sql.FunctionCall(
1658
new
SqlExpression
[] {
1664
SqlExpression
@else = sql.Subtract(sql.FunctionCall(typeof(int), "CHARINDEX",
1665
new
SqlExpression
[] {
1680
SqlExpression
exprPart = mc.Arguments[0];
1684
SqlExpression
exprS = mc.Object;
1685
SqlExpression
reverseS = sql.FunctionCall(typeof(string), "REVERSE", new
SqlExpression
[] { exprS }, source);
1686
SqlExpression
reversePart = sql.FunctionCall(typeof(string), "REVERSE", new
SqlExpression
[] { exprPart }, source);
1687
SqlExpression
charIndex = sql.FunctionCall(typeof(int), "CHARINDEX", new
SqlExpression
[] { exprPart, exprS }, source);
1688
SqlExpression
charIndexOfReverse = sql.FunctionCall(typeof(int), "CHARINDEX", new
SqlExpression
[] { reversePart, reverseS }, source);
1689
SqlExpression
notContained = sql.Binary(SqlNodeType.EQ, charIndex, sql.ValueFromObject(0, false, source));
1690
SqlExpression
len1 = sql.CLRLENGTH(exprS);
1691
SqlExpression
len2 = sql.CLRLENGTH(exprPart);
1692
SqlExpression
elseCase = sql.Add(sql.ValueFromObject(1, false, source), sql.Subtract(len1, sql.Add(len2, charIndexOfReverse)));
1697
SqlExpression
lenZeroExpr = sql.Binary(SqlNodeType.EQ, sql.CLRLENGTH(mc.Arguments[0]), sql.ValueFromObject(0, source));
1712
SqlExpression
s = mc.Object;
1713
SqlExpression
part = mc.Arguments[0];
1717
SqlExpression
i = mc.Arguments[1];
1718
SqlExpression
first = sql.FunctionCall(typeof(string), "LEFT", new
SqlExpression
[] { s, sql.Add(i, 1) }, source);
1719
SqlExpression
reverseFirst = sql.FunctionCall(typeof(string), "REVERSE", new
SqlExpression
[] { first }, source);
1720
SqlExpression
reversePart = sql.FunctionCall(typeof(string), "REVERSE", new
SqlExpression
[] { part }, source);
1721
SqlExpression
charIndex = sql.FunctionCall(typeof(int), "CHARINDEX", new
SqlExpression
[] { part, first }, source);
1722
SqlExpression
charIndexOfReverse = sql.FunctionCall(typeof(int), "CHARINDEX", new
SqlExpression
[] { reversePart, reverseFirst }, source);
1723
SqlExpression
notContained = sql.Binary(SqlNodeType.EQ, charIndex, sql.ValueFromObject(0, false, source));
1724
SqlExpression
len1 = sql.CLRLENGTH(first);
1725
SqlExpression
len2 = sql.CLRLENGTH(part);
1726
SqlExpression
elseCase = sql.Add(sql.ValueFromObject(1, false, source), sql.Subtract(len1, sql.Add(len2, charIndexOfReverse)));
1732
SqlExpression
lenZeroExpr = sql.Binary(SqlNodeType.EQ, sql.CLRLENGTH(mc.Arguments[0]), sql.ValueFromObject(0, source));
1748
SqlExpression
s = mc.Object;
1749
SqlExpression
part = mc.Arguments[0];
1753
SqlExpression
i = mc.Arguments[1];
1754
SqlExpression
count = mc.Arguments[2];
1755
SqlExpression
first = sql.FunctionCall(typeof(string), "LEFT", new
SqlExpression
[] { s, sql.Add(i, 1) }, source);
1756
SqlExpression
reverseFirst = sql.FunctionCall(typeof(string), "REVERSE", new
SqlExpression
[] { first }, source);
1757
SqlExpression
reversePart = sql.FunctionCall(typeof(string), "REVERSE", new
SqlExpression
[] { part }, source);
1758
SqlExpression
charIndex = sql.FunctionCall(typeof(int), "CHARINDEX", new
SqlExpression
[] { part, first }, source);
1759
SqlExpression
charIndexOfReverse = sql.FunctionCall(typeof(int), "CHARINDEX", new
SqlExpression
[] { reversePart, reverseFirst }, source);
1760
SqlExpression
len1 = sql.CLRLENGTH(first);
1761
SqlExpression
len2 = sql.CLRLENGTH(part);
1762
SqlExpression
elseCase = sql.Add(sql.ValueFromObject(1, false, source), sql.Subtract(len1, sql.Add(len2, charIndexOfReverse)));
1763
SqlExpression
notContained = sql.Binary(SqlNodeType.EQ, charIndex, sql.ValueFromObject(0, false, source));
1770
SqlExpression
lenZeroExpr = sql.Binary(SqlNodeType.EQ, sql.CLRLENGTH(mc.Arguments[0]), sql.ValueFromObject(0, source));
1786
new
SqlExpression
[] {
1798
SqlExpression
insertingAtEnd = sql.Binary(SqlNodeType.EQ, sql.CLRLENGTH(mc.Object), mc.Arguments[0]);
1799
SqlExpression
stringConcat = sql.Concat(mc.Object, mc.Arguments[1]);
1810
SqlExpression
exprS = mc.Object;
1811
SqlExpression
exprI = mc.Arguments[0];
1812
SqlExpression
len2 = sql.CLRLENGTH(exprS);
1813
SqlExpression
dontChange = sql.Binary(SqlNodeType.GE, len2, exprI);
1814
SqlExpression
numSpaces = sql.Subtract(exprI, len2);
1815
SqlExpression
padding = sql.FunctionCall(typeof(string), "SPACE", new
SqlExpression
[] { numSpaces }, source);
1816
SqlExpression
elseCase = sql.Concat(padding, exprS);
1825
SqlExpression
exprS = mc.Object;
1826
SqlExpression
exprI = mc.Arguments[0];
1827
SqlExpression
exprC = mc.Arguments[1];
1828
SqlExpression
dontChange = sql.Binary(SqlNodeType.GE, sql.CLRLENGTH(exprS), exprI);
1829
SqlExpression
len2 = sql.CLRLENGTH(exprS);
1830
SqlExpression
numSpaces = sql.Subtract(exprI, len2);
1831
SqlExpression
padding = sql.FunctionCall(typeof(string), "REPLICATE", new
SqlExpression
[] { exprC, numSpaces }, source);
1832
SqlExpression
elseCase = sql.Concat(padding, exprS);
1843
SqlExpression
exprS = mc.Object;
1844
SqlExpression
exprI = mc.Arguments[0];
1845
SqlExpression
dontChange = sql.Binary(SqlNodeType.GE, sql.CLRLENGTH(exprS), exprI);
1846
SqlExpression
len2 = sql.CLRLENGTH(exprS);
1847
SqlExpression
numSpaces = sql.Subtract(exprI, len2);
1848
SqlExpression
padding = sql.FunctionCall(typeof(string), "SPACE", new
SqlExpression
[] { numSpaces }, source);
1849
SqlExpression
elseCase = sql.Concat(exprS, padding);
1858
SqlExpression
exprS = mc.Object;
1859
SqlExpression
exprI = mc.Arguments[0];
1860
SqlExpression
exprC = mc.Arguments[1];
1861
SqlExpression
dontChange = sql.Binary(SqlNodeType.GE, sql.CLRLENGTH(exprS), exprI);
1862
SqlExpression
len2 = sql.CLRLENGTH(exprS);
1863
SqlExpression
numSpaces = sql.Subtract(exprI, len2);
1864
SqlExpression
padding = sql.FunctionCall(typeof(string), "REPLICATE", new
SqlExpression
[] { exprC, numSpaces }, source);
1865
SqlExpression
elseCase = sql.Concat(exprS, padding);
1875
new
SqlExpression
[] {
1886
new
SqlExpression
[] {
1904
new
SqlExpression
[] {
1914
new
SqlExpression
[] {
1924
new
SqlExpression
[] {
1936
new
SqlExpression
[] {
1937
sql.FunctionCall(typeof(string), "RTRIM", new
SqlExpression
[] { mc.Object }, source)
1944
return sql.FunctionCall(typeof(string), "LOWER", new
SqlExpression
[] { mc.Object }, source);
1949
return sql.FunctionCall(typeof(string), "UPPER", new
SqlExpression
[] { mc.Object }, source);
1955
return sql.FunctionCall(typeof(char), "SUBSTRING", new
SqlExpression
[]
1974
private
SqlExpression
TranslateMathMethod(SqlMethodCall mc) {
1979
return sql.FunctionCall(mc.Arguments[0].ClrType, "ABS", new
SqlExpression
[] { mc.Arguments[0] }, source);
2019
SqlExpression
x = mc.Arguments[0];
2020
SqlExpression
expX = sql.FunctionCall(typeof(double), "EXP", new
SqlExpression
[] { x }, source);
2021
SqlExpression
minusX = sql.Unary(SqlNodeType.Negate, x, source);
2022
SqlExpression
expMinusX = sql.FunctionCall(typeof(double), "EXP", new
SqlExpression
[] { minusX }, source);
2044
SqlExpression
log1 = sql.FunctionCall(typeof(double), "LOG", new
SqlExpression
[] { mc.Arguments[0] }, source);
2045
SqlExpression
log2 = sql.FunctionCall(typeof(double), "LOG", new
SqlExpression
[] { mc.Arguments[1] }, source);
2057
SqlExpression
a = mc.Arguments[0];
2058
SqlExpression
b = mc.Arguments[1];
2059
SqlExpression
aLower = sql.Binary(SqlNodeType.LT, a, b);
2066
SqlExpression
a = mc.Arguments[0];
2067
SqlExpression
b = mc.Arguments[1];
2068
SqlExpression
aLower = sql.Binary(SqlNodeType.LT, a, b);
2083
SqlExpression
x = mc.Arguments[0];
2084
SqlExpression
i = null;
2091
SqlExpression
roundingMethod = mc.Arguments[nParams - 1];
2097
return sql.FunctionCall(x.ClrType, "round", new
SqlExpression
[] { x, i }, source);
2105
SqlExpression
roundX = sql.FunctionCall(type, "round", new
SqlExpression
[] { x, i }, source);
2106
SqlExpression
twiceX = sql.Multiply(x, 2);
2107
SqlExpression
round2X = sql.FunctionCall(type, "round", new
SqlExpression
[] { twiceX, i }, source);
2108
SqlExpression
condition = sql.AndAccumulate(sql.Binary(SqlNodeType.EQ, twiceX, round2X), sql.Binary(SqlNodeType.NE, x, roundX));
2109
SqlExpression
specialCase = sql.Multiply(sql.FunctionCall(type, "round", new
SqlExpression
[] { sql.Divide(x, 2), i }, source), 2);
2115
return sql.FunctionCall(typeof(int), "SIGN", new
SqlExpression
[] { mc.Arguments[0] }, source);
2125
SqlExpression
x = mc.Arguments[0];
2126
SqlExpression
exp = sql.FunctionCall(typeof(double), "EXP", new
SqlExpression
[] { x }, source);
2127
SqlExpression
minusX = sql.Unary(SqlNodeType.Negate, x, source);
2128
SqlExpression
expMinus = sql.FunctionCall(typeof(double), "EXP", new
SqlExpression
[] { minusX }, source);
2144
SqlExpression
x = mc.Arguments[0];
2145
SqlExpression
expX = sql.FunctionCall(typeof(double), "EXP", new
SqlExpression
[] { x }, source);
2146
SqlExpression
minusX = sql.Unary(SqlNodeType.Negate, x, source);
2147
SqlExpression
expMinusX = sql.FunctionCall(typeof(double), "EXP", new
SqlExpression
[] { minusX }, source);
2154
SqlExpression
x = mc.Arguments[0];
2155
return sql.FunctionCall(mc.Method.ReturnType, "ROUND", new
SqlExpression
[] { x, sql.ValueFromObject(0, false, source), sql.ValueFromObject(1, false, source) }, source);
2164
SqlExpression
exp = this.VisitExpression(m.Expression);
2185
SqlExpression
date = new SqlVariable(typeof(void), null, "DATE", source);
2186
return sql.FunctionCall(typeof(DateTime), "CONVERT", new
SqlExpression
[2] { date, exp }, source);
2194
SqlExpression
ms = sql.DATEPART("MILLISECOND", exp);
2195
SqlExpression
ss = sql.DATEPART("SECOND", exp);
2196
SqlExpression
mi = sql.DATEPART("MINUTE", exp);
2197
SqlExpression
hh = sql.DATEPART("HOUR", exp);
2199
SqlExpression
result = exp;
2210
SqlExpression
datetime = new SqlVariable(typeof(void), null, "DATETIME", source);
2211
return sql.FunctionCall(typeof(DateTime), "CONVERT", new
SqlExpression
[2] { datetime, exp }, source);
2214
SqlExpression
hours = sql.DATEPART("HOUR", exp);
2215
SqlExpression
minutes = sql.DATEPART("MINUTE", exp);
2216
SqlExpression
seconds = sql.DATEPART("SECOND", exp);
2217
SqlExpression
milliseconds = sql.DATEPART("MILLISECOND", exp);
2219
SqlExpression
ticksFromHour = sql.Multiply(sql.ConvertToBigint(hours), TimeSpan.TicksPerHour);
2220
SqlExpression
ticksFromMinutes = sql.Multiply(sql.ConvertToBigint(minutes), TimeSpan.TicksPerMinute);
2221
SqlExpression
ticksFromSeconds = sql.Multiply(sql.ConvertToBigint(seconds), TimeSpan.TicksPerSecond);
2222
SqlExpression
ticksFromMs = sql.Multiply(sql.ConvertToBigint(milliseconds), TimeSpan.TicksPerMillisecond);
2227
SqlExpression
sqlDay = sql.DATEPART("dw", exp);
2340
private
SqlExpression
CreateDateTimeFromDateAndTicks(
SqlExpression
sqlDate,
SqlExpression
sqlTicks, Expression source) {
2344
private
SqlExpression
CreateDateTimeFromDateAndTicks(
SqlExpression
sqlDate,
SqlExpression
sqlTicks, Expression source, bool asNullable) {
2345
SqlExpression
daysAdded = sql.DATEADD("day", sql.Divide(sqlTicks, TimeSpan.TicksPerDay), sqlDate, source, asNullable);
2350
private
SqlExpression
CreateDateTimeFromDateAndMs(
SqlExpression
sqlDate,
SqlExpression
ms, Expression source) {
2354
private
SqlExpression
CreateDateTimeFromDateAndMs(
SqlExpression
sqlDate,
SqlExpression
ms, Expression source, bool asNullable) {
2355
SqlExpression
msBigint = sql.ConvertToBigint(ms);
2356
SqlExpression
daysAdded = sql.DATEADD("day", sql.Divide(msBigint, 86400000), sqlDate, source, asNullable);
2361
private
SqlExpression
CreateDateTimeOffsetFromDateAndTicks(
SqlExpression
sqlDate,
SqlExpression
sqlTicks, Expression source) {
2365
private
SqlExpression
CreateDateTimeOffsetFromDateAndTicks(
SqlExpression
sqlDate,
SqlExpression
sqlTicks, Expression source, bool asNullable) {
2366
SqlExpression
daysAdded = sql.DATETIMEOFFSETADD("day", sql.Divide(sqlTicks, TimeSpan.TicksPerDay), sqlDate, source, asNullable);
2371
private
SqlExpression
CreateDateTimeOffsetFromDateAndMs(
SqlExpression
sqlDate,
SqlExpression
ms, Expression source) {
2375
private
SqlExpression
CreateDateTimeOffsetFromDateAndMs(
SqlExpression
sqlDate,
SqlExpression
ms, Expression source, bool asNullable) {
2376
SqlExpression
msBigint = sql.ConvertToBigint(ms);
2377
SqlExpression
daysAdded = sql.DATETIMEOFFSETADD("day", sql.Divide(msBigint, 86400000), sqlDate, source, asNullable);
2381
private
SqlExpression
TranslateVbConversionMethod(SqlMethodCall mc) {
2384
SqlExpression
expr = mc.Arguments[0];
2438
List<
SqlExpression
> matchesList = new List<
SqlExpression
>();
2439
List<
SqlExpression
> valuesList = new List<
SqlExpression
>();
2460
private
SqlExpression
TranslateVbCompareString(SqlMethodCall mc) {
2467
private
SqlExpression
TranslateVbLikeString(SqlMethodCall mc) {
2475
SqlExpression
pattern = mc.Arguments[1];
2496
SqlExpression
escape = needsEscape ? sql.ValueFromObject("~", false, mc.SourceExpression) : null;
SqlClient\Query\SqlMethodTransformer.cs (6)
19
internal override
SqlExpression
VisitFunctionCall(SqlFunctionCall fc) {
21
SqlExpression
result = base.VisitFunctionCall(fc);
26
SqlExpression
expr = resultFunctionCall.Arguments[0];
52
internal override
SqlExpression
VisitUnaryOperator(SqlUnary fc) {
54
SqlExpression
result = base.VisitUnaryOperator(fc);
60
SqlExpression
expr = unary.Operand;
SqlClient\Query\SqlMultiplexer.cs (39)
43
internal override
SqlExpression
VisitMultiset(SqlSubSelect sms) {
58
SqlExpression
expr = (
SqlExpression
)SqlDuplicator.Copy(sms.Select.Selection);
65
SqlExpression
count = sql.SubSelect(SqlNodeType.ScalarSubSelect, countSelect);
77
internal override
SqlExpression
VisitElement(SqlSubSelect elem) {
81
internal override
SqlExpression
VisitScalarSubSelect(SqlSubSelect ss) {
95
internal override
SqlExpression
VisitExists(SqlSubSelect ss) {
139
internal override
SqlExpression
VisitClientCase(SqlClientCase c) {
150
internal override
SqlExpression
VisitSimpleCase(SqlSimpleCase c) {
161
internal override
SqlExpression
VisitSearchedCase(SqlSearchedCase c) {
172
internal override
SqlExpression
VisitTypeCase(SqlTypeCase tc) {
183
internal override
SqlExpression
VisitOptionalValue(SqlOptionalValue sov) {
214
List<
SqlExpression
> externals;
217
internal Visitor(List<
SqlExpression
> externals, List<SqlParameter> parameters)
223
internal override
SqlExpression
VisitColumnRef(SqlColumnRef cref) {
224
SqlExpression
result = base.VisitColumnRef(cref);
231
internal override
SqlExpression
VisitUserColumn(SqlUserColumn suc) {
232
SqlExpression
result = base.VisitUserColumn(suc);
239
private
SqlExpression
ExtractParameter(
SqlExpression
expr) {
254
SqlExpression
[] exprs = new
SqlExpression
[link.KeyExpressions.Count];
264
internal static bool HasHierarchy(
SqlExpression
expr) {
273
internal override
SqlExpression
VisitMultiset(SqlSubSelect sms) {
278
internal override
SqlExpression
VisitElement(SqlSubSelect elem) {
283
internal override
SqlExpression
VisitClientQuery(SqlClientQuery cq) {
288
internal override
SqlExpression
VisitExists(SqlSubSelect ss) {
292
internal override
SqlExpression
VisitScalarSubSelect(SqlSubSelect ss) {
299
internal static bool HasMultiset(
SqlExpression
expr) {
308
internal override
SqlExpression
VisitMultiset(SqlSubSelect sms) {
313
internal override
SqlExpression
VisitElement(SqlSubSelect elem) {
317
internal override
SqlExpression
VisitClientQuery(SqlClientQuery cq) {
321
internal override
SqlExpression
VisitExists(SqlSubSelect ss) {
325
internal override
SqlExpression
VisitScalarSubSelect(SqlSubSelect ss) {
341
internal override
SqlExpression
VisitMultiset(SqlSubSelect sms) {
345
internal override
SqlExpression
VisitElement(SqlSubSelect elem) {
349
internal override
SqlExpression
VisitClientQuery(SqlClientQuery cq) {
353
internal override
SqlExpression
VisitExists(SqlSubSelect ss) {
357
internal override
SqlExpression
VisitScalarSubSelect(SqlSubSelect ss) {
SqlClient\Query\SqlNamer.cs (15)
45
internal override
SqlExpression
VisitScalarSubSelect(SqlSubSelect ss) {
145
internal override
SqlExpression
VisitExpression(
SqlExpression
expr) {
149
return (
SqlExpression
)this.Visit(expr);
156
private
SqlExpression
VisitNamedExpression(
SqlExpression
expr, string name) {
160
return (
SqlExpression
)this.Visit(expr);
167
internal override
SqlExpression
VisitColumnRef(SqlColumnRef cref) {
174
internal override
SqlExpression
VisitNew(SqlNew sox) {
196
internal override
SqlExpression
VisitGrouping(SqlGrouping g) {
202
internal override
SqlExpression
VisitOptionalValue(SqlOptionalValue sov) {
208
internal override
SqlExpression
VisitMethodCall(SqlMethodCall mc) {
230
internal static string DiscoverName(
SqlExpression
e) {
255
internal override
SqlExpression
VisitColumn(SqlColumn col) {
263
internal override
SqlExpression
VisitColumnRef(SqlColumnRef cref) {
SqlClient\Query\SqlOuterApplyReducer.cs (29)
35
HashSet<
SqlExpression
> liftedExpressions = new HashSet<
SqlExpression
>();
41
SqlExpression
liftedPredicate = SqlPredicateLifter.Lift(join.Right, leftProducedAliases);
82
HashSet<
SqlExpression
> liftedExpressions = new HashSet<
SqlExpression
>();
89
SqlExpression
liftedPredicate = SqlPredicateLifter.Lift(leftOuter.Right, leftProducedAliases);
129
SqlExpression
jCondition = join.Condition;
220
internal override
SqlExpression
VisitColumnRef(SqlColumnRef cref) {
242
internal bool ReferencesAny(
SqlExpression
expression) {
254
internal override
SqlExpression
VisitColumnRef(SqlColumnRef cref) {
264
internal override
SqlExpression
VisitColumn(SqlColumn col) {
274
internal static bool IsDependent(SqlNode node, HashSet<SqlAlias> aliasesToCheck, HashSet<
SqlExpression
> ignoreExpressions) {
281
HashSet<
SqlExpression
> ignoreExpressions;
284
internal Visitor(HashSet<SqlAlias> aliasesToCheck, HashSet<
SqlExpression
> ignoreExpressions) {
289
SqlExpression
e = node as
SqlExpression
;
297
internal override
SqlExpression
VisitColumnRef(SqlColumnRef cref) {
306
internal override
SqlExpression
VisitColumn(SqlColumn col) {
316
internal static bool CanLift(SqlSource source, HashSet<SqlAlias> aliasesForLifting, HashSet<
SqlExpression
> liftedExpressions) {
324
internal static
SqlExpression
Lift(SqlSource source, HashSet<SqlAlias> aliasesForLifting) {
334
HashSet<
SqlExpression
> liftedExpressions;
337
internal
SqlExpression
lifted;
341
internal Visitor(bool doLifting, HashSet<SqlAlias> aliasesForLifting, HashSet<
SqlExpression
> liftedExpressions) {
384
internal static bool CanLift(SqlSource source, HashSet<SqlAlias> aliasesForLifting, HashSet<
SqlExpression
> liftedExpressions) {
390
internal static List<List<SqlColumn>> Lift(SqlSource source, HashSet<SqlAlias> aliasesForLifting, HashSet<
SqlExpression
> liftedExpressions) {
399
HashSet<
SqlExpression
> liftedExpressions;
406
internal Visitor(bool doLifting, HashSet<SqlAlias> aliasesForLifting, HashSet<
SqlExpression
> liftedExpressions) {
429
foreach(
SqlExpression
e in select.GroupBy) {
496
private void ReferenceColumns(
SqlExpression
expression) {
SqlClient\Query\SqlParameterizer.cs (6)
129
internal override
SqlExpression
VisitBinaryOperator(SqlBinary bo)
183
internal
SqlExpression
VisitParameter(
SqlExpression
expr) {
184
SqlExpression
result = this.VisitExpression(expr);
280
internal override
SqlExpression
VisitValue(SqlValue value) {
289
internal override
SqlExpression
VisitClientParameter(SqlClientParameter cp) {
SqlClient\Query\SqlRemoveConstantOrderBy.cs (1)
26
SqlExpression
expr = orders[i].Expression;
SqlClient\Query\SqlReorderer.cs (3)
44
internal override
SqlExpression
VisitSubSelect(SqlSubSelect ss) {
198
select.OrderBy.Add(new SqlOrderExpression(sox.OrderType, (
SqlExpression
)dup.Duplicate(sox.Expression)));
256
rowNumber.OrderBy.Add(new SqlOrderExpression(sox.OrderType, (
SqlExpression
)dup.Duplicate(sox.Expression)));
SqlClient\Query\SqlResolver.cs (4)
34
internal override
SqlExpression
VisitColumnRef(SqlColumnRef cref) {
79
internal override
SqlExpression
VisitSubSelect(SqlSubSelect ss) {
231
internal override
SqlExpression
VisitTableValuedFunctionCall(SqlTableValuedFunctionCall fc) {
263
foreach (
SqlExpression
exp in select.GroupBy) {
SqlClient\Query\SqlRetyper.cs (28)
26
internal override
SqlExpression
VisitColumn(SqlColumn col) {
30
internal override
SqlExpression
VisitUnaryOperator(SqlUnary uo) {
59
internal override
SqlExpression
VisitBinaryOperator(SqlBinary bo) {
80
SqlExpression
left = bo.Left;
81
SqlExpression
right = bo.Right;
91
Func<
SqlExpression
,
SqlExpression
, bool> needsRetype =
108
internal override
SqlExpression
VisitIn(SqlIn sin) {
112
SqlExpression
test = sin.Expression;
114
var newValues = new System.Collections.Generic.List<
SqlExpression
>(sin.Values.Count);
117
SqlExpression
value = sin.Values[i];
138
internal override
SqlExpression
VisitLike(SqlLike like) {
150
internal override
SqlExpression
VisitScalarSubSelect(SqlSubSelect ss) {
156
internal override
SqlExpression
VisitSearchedCase(SqlSearchedCase c) {
182
internal override
SqlExpression
VisitSimpleCase(SqlSimpleCase c) {
202
SqlExpression
right = sa.RValue;
208
internal override
SqlExpression
VisitFunctionCall(SqlFunctionCall fc) {
225
private void CoerceToFirst(
SqlExpression
arg1, ref
SqlExpression
arg2) {
243
private void CoerceBinaryArgs(ref
SqlExpression
arg1, ref
SqlExpression
arg2)
259
private void CoerceTypeFamily(
SqlExpression
arg1,
SqlExpression
arg2)
279
private static void SetSqlTypeIfSimpleExpression(
SqlExpression
expression, ProviderType sqlType)
287
private void CoerceTypes(ref
SqlExpression
arg1, ref
SqlExpression
arg2)
312
private
SqlExpression
CoerceValueForExpression(SqlValue value,
SqlExpression
expression)
SqlClient\Query\SqlRewriteScalarSubqueries.cs (1)
31
internal override
SqlExpression
VisitScalarSubSelect(SqlSubSelect ss) {
SqlClient\Query\SqlSupersetValidator.cs (13)
39
SqlExpression
expr = this.VisitExpression(col.Expression);
55
internal override
SqlExpression
VisitValue(SqlValue value) {
66
internal override
SqlExpression
VisitBinaryOperator(SqlBinary bo) {
80
internal override
SqlExpression
ConvertValueToPredicate(
SqlExpression
bitExpression) {
84
internal override
SqlExpression
ConvertPredicateToValue(
SqlExpression
predicateExpression) {
94
internal override
SqlExpression
VisitMethodCall(SqlMethodCall mc) {
118
internal override
SqlExpression
VisitColumn(SqlColumn col) {
124
internal override
SqlExpression
VisitAliasRef(SqlAliasRef aref) {
130
internal override
SqlExpression
VisitSharedExpression(SqlSharedExpression shared) {
133
internal override
SqlExpression
VisitSharedExpressionRef(SqlSharedExpressionRef sref) {
144
internal override
SqlExpression
VisitBinaryOperator(SqlBinary bo) {
SqlClient\Query\SqlTypeConverter.cs (10)
71
internal override
SqlExpression
VisitUnaryOperator(SqlUnary uo) {
88
return sql.FunctionCall(uo.ClrType, "NCHAR", new
SqlExpression
[] { uo.Operand }, uo.SourceExpression);
101
return sql.FunctionCall(newClrType, sql.TypeProvider.From(typeof(int)), "UNICODE", new
SqlExpression
[] { uo.Operand }, uo.SourceExpression);
121
private
SqlExpression
ConvertDoubleToString(
SqlExpression
expr, Type resultClrType) {
124
SqlExpression
nvarchar = sql.FunctionCall(
126
new
SqlExpression
[] { sql.ValueFromObject(30, false, expr.SourceExpression) },
131
new
SqlExpression
[] { nvarchar, expr, sql.ValueFromObject(2, false, expr.SourceExpression) },
136
private
SqlExpression
ConvertBitToString(
SqlExpression
expr, Type resultClrType) {
SqlClient\Query\Translator.cs (41)
37
SqlExpression
projection = this.BuildProjection(tableAliasRef, table.RowType, allowDeferred, link, source);
41
internal
SqlExpression
BuildProjection(
SqlExpression
item, MetaType rowType, bool allowDeferred, SqlLink link, Expression source) {
65
SqlExpression
match = sql.Value(dt, sql.Default(discriminator), code, true, source);
88
private SqlNew BuildProjectionInternal(
SqlExpression
item, MetaType rowType, IEnumerable<MetaDataMember> members, bool allowDeferred, SqlLink link, Expression source) {
118
private SqlLink BuildLink(
SqlExpression
item, MetaDataMember member, Expression source) {
120
SqlExpression
[] exprs = new
SqlExpression
[member.Association.ThisKey.Count];
132
List<
SqlExpression
> exprs = new List<
SqlExpression
>();
136
SqlExpression
expansion = sql.Member(item, member.Member);
241
internal SqlNode TranslateLink(SqlLink link, List<
SqlExpression
> keyExpressions, bool asExpression) {
285
internal
SqlExpression
TranslateEquals(SqlBinary expr) {
289
SqlExpression
eLeft = expr.Left;
290
SqlExpression
eRight = expr.Right;
338
List<
SqlExpression
> exprs1;
339
List<
SqlExpression
> exprs2;
361
SqlExpression
exp = null;
364
SqlExpression
eq = this.TranslateEqualsOp(eqKind, exprs1[i], exprs2[i], !mtLeft.IsEntity);
378
private
SqlExpression
TranslateEqualsOp(SqlNodeType op,
SqlExpression
left,
SqlExpression
right, bool allowExpand) {
390
sql.Unary(SqlNodeType.IsNull, (
SqlExpression
)SqlDuplicator.Copy(left)),
391
sql.Unary(SqlNodeType.IsNull, (
SqlExpression
)SqlDuplicator.Copy(right))
395
sql.Unary(SqlNodeType.IsNotNull, (
SqlExpression
)SqlDuplicator.Copy(left)),
396
sql.Unary(SqlNodeType.IsNotNull, (
SqlExpression
)SqlDuplicator.Copy(right))
414
sql.Unary(SqlNodeType.IsNull, (
SqlExpression
)SqlDuplicator.Copy(left)),
415
sql.Unary(SqlNodeType.IsNull, (
SqlExpression
)SqlDuplicator.Copy(right))
419
sql.Unary(SqlNodeType.IsNotNull, (
SqlExpression
)SqlDuplicator.Copy(left)),
420
sql.Unary(SqlNodeType.IsNotNull, (
SqlExpression
)SqlDuplicator.Copy(right))
436
internal
SqlExpression
TranslateLinkEquals(SqlBinary bo) {
446
internal
SqlExpression
TranslateLinkIsNull(SqlUnary expr) {
454
List<
SqlExpression
> exprs = link.KeyExpressions;
457
SqlExpression
exp = null;
460
SqlExpression
compare = sql.Unary(expr.NodeType, sql.DoNotVisitExpression(exprs[i]), expr.SourceExpression);
477
private static
SqlExpression
BestIdentityNode(SqlTypeCase tc) {
511
private List<
SqlExpression
> GetIdentityExpressions(MetaType type,
SqlExpression
expr) {
514
List<
SqlExpression
> exprs = new List<
SqlExpression
>(members.Count);
516
exprs.Add(sql.Member((
SqlExpression
)SqlDuplicator.Copy(expr), mm));
SqlClient\Query\TypeSource.cs (6)
31
internal
SqlExpression
sourceExpression;
38
sourceExpression = node as
SqlExpression
;
117
internal override
SqlExpression
VisitAliasRef(SqlAliasRef aref) {
127
internal override
SqlExpression
VisitColumnRef(SqlColumnRef cref) {
149
internal static
SqlExpression
GetTypeSource(
SqlExpression
expr) {
SqlClient\Reader\ObjectReader.cs (1)
38
IObjectReaderFactory Compile(
SqlExpression
expression, Type elementType);
SqlClient\Reader\ObjectReaderCompiler.cs (25)
183
public IObjectReaderFactory Compile(
SqlExpression
expression, Type elementType) {
233
internal override
SqlExpression
VisitColumnRef(SqlColumnRef cref) {
234
SqlExpression
result = base.VisitColumnRef(cref);
245
internal override
SqlExpression
VisitAliasRef(SqlAliasRef aref) {
246
SqlExpression
result = base.VisitAliasRef(aref);
279
private DynamicMethod CompileDynamicMethod(Generator gen,
SqlExpression
expression, Type elementType) {
300
internal
SqlExpression
projection;
302
public CacheInfo(Type elementType, Type dataReaderType, object mapping, DataLoadOptions options,
SqlExpression
projection, IObjectReaderFactory factory) {
317
internal IObjectReaderFactory GetFactory(Type elementType, Type dataReaderType, object mapping, DataLoadOptions options,
SqlExpression
projection) {
334
internal void AddFactory(Type elementType, Type dataReaderType, object mapping, DataLoadOptions options,
SqlExpression
projection, IObjectReaderFactory factory) {
344
internal static bool CanBeCompared(
SqlExpression
node) {
465
internal static bool AreSimilar(
SqlExpression
node1,
SqlExpression
node2) {
657
internal override
SqlExpression
VisitJoinedCollection(SqlJoinedCollection jc) {
662
internal override
SqlExpression
VisitClientQuery(SqlClientQuery cq) {
685
internal void GenerateBody(ILGenerator generator,
SqlExpression
expression) {
1053
private void GenerateMemberAssignment(MetaDataMember mm, LocalBuilder locInstance,
SqlExpression
expr, LocalBuilder locStoreInMember) {
1106
private void GenerateAssignValue(MetaDataMember mm, LocalBuilder locInstance,
SqlExpression
expr, LocalBuilder locStoreInMember) {
1155
private void GenerateAssignDeferredEntitySet(MetaDataMember mm, LocalBuilder locInstance,
SqlExpression
expr, LocalBuilder locStoreInMember) {
1217
private void GenerateAssignEntitySet(MetaDataMember mm, LocalBuilder locInstance,
SqlExpression
expr, LocalBuilder locStoreInMember) {
1275
private void GenerateAssignDeferredReference(MetaDataMember mm, LocalBuilder locInstance,
SqlExpression
expr, LocalBuilder locStoreInMember) {
1329
private bool IsDeferrableExpression(
SqlExpression
expr) {
1408
private Type GenerateDeferredSource(
SqlExpression
expr, LocalBuilder locInstance) {
1550
private Type GenerateExpressionForType(
SqlExpression
expr, Type type) {
1554
private Type GenerateExpressionForType(
SqlExpression
expr, Type type, LocalBuilder locInstance) {
SqlClient\SqlProvider.cs (3)
965
internal override
SqlExpression
VisitSubSelect(SqlSubSelect ss) {
969
internal override
SqlExpression
VisitClientQuery(SqlClientQuery cq) {
1638
SqlExpression
projection = null;