504 references to ClrType
System.Data.Linq (504)
SqlClient\Common\Expressions.cs (1)
26
return new KnownExpression(expr, expr.
ClrType
);
SqlClient\Common\SqlFactory.cs (9)
351
clrType = expression.
ClrType
.Equals(typeof(bool?)) ? typeof(bool?) : typeof(bool);
354
clrType = expression.
ClrType
;
370
Type valueType = TypeSystem.GetNonNullableType(expression.
ClrType
);
398
clrType = right.
ClrType
;
404
clrType = left.
ClrType
;
433
return new SqlSearchedCase(whens[0].Value.
ClrType
, whens, @else, sourceExpression);
531
return new SqlExprSet(exprs[0].
ClrType
, exprs, sourceExpression);
542
clrType = select.Selection.
ClrType
;
547
clrType = typeof(List<>).MakeGenericType(select.Selection.
ClrType
);
SqlClient\Common\SqlNode.cs (127)
335
if (value != null && TypeSystem.GetNonNullableType(value.
ClrType
) != typeof(bool)) {
336
throw Error.ArgumentWrongType("value", "bool", value.
ClrType
);
349
if (value != null && TypeSystem.GetNonNullableType(value.
ClrType
) != typeof(bool)) {
350
throw Error.ArgumentWrongType("value", "bool", value.
ClrType
);
450
if (this.projection != null && this.projection.
ClrType
!= value.
ClrType
)
451
throw Error.ArgumentWrongType("value", this.projection.
ClrType
, value.
ClrType
);
507
if (value.Projection != null && value.Projection.
ClrType
!= this.
ClrType
)
508
throw Error.ArgumentWrongType("value", this.
ClrType
, value.Projection.
ClrType
);
596
if (TypeSystem.IsSequenceType(exp.
ClrType
))
597
return TypeSystem.GetElementType(exp.
ClrType
);
598
return exp.
ClrType
;
602
return sel.Selection.
ClrType
;
724
return exp.
ClrType
;
727
return sel.Selection.
ClrType
;
796
if (this.expression != null && !this.expression.
ClrType
.IsAssignableFrom(value.
ClrType
))
797
throw Error.ArgumentWrongType("value", this.expression.
ClrType
, value.
ClrType
);
1075
if (value.
ClrType
!= typeof(string))
1076
throw Error.ArgumentWrongType("value", "string", value.
ClrType
);
1086
if (value.
ClrType
!= typeof(string))
1087
throw Error.ArgumentWrongType("value", "string", value.
ClrType
);
1095
if (value != null && value.
ClrType
!= typeof(string))
1096
throw Error.ArgumentWrongType("value", "string", value.
ClrType
);
1117
if (this.matchExpression != null && value != null && this.matchExpression.
ClrType
!= value.
ClrType
1119
&& !TypeSystem.GetNonNullableType(this.matchExpression.
ClrType
).Equals(typeof(bool))
1120
&& !TypeSystem.GetNonNullableType(value.
ClrType
).Equals(typeof(bool)))
1121
throw Error.ArgumentWrongType("value", this.matchExpression.
ClrType
, value.
ClrType
);
1131
if (this.valueExpression != null && !this.valueExpression.
ClrType
.IsAssignableFrom(value.
ClrType
))
1132
throw Error.ArgumentWrongType("value", this.valueExpression.
ClrType
, value.
ClrType
);
1171
if (this.@else != null && !this.@else.
ClrType
.IsAssignableFrom(value.
ClrType
))
1172
throw Error.ArgumentWrongType("value", this.@else.
ClrType
, value.
ClrType
);
1211
if (this.expression != null && this.expression.
ClrType
!= value.
ClrType
)
1212
throw Error.ArgumentWrongType("value", this.expression.
ClrType
, value.
ClrType
);
1255
if (this.expression != null && this.expression.
ClrType
!= value.
ClrType
)
1256
throw Error.ArgumentWrongType("value", this.expression.
ClrType
, value.
ClrType
);
1288
if (this.matchExpression != null && value != null && this.matchExpression.
ClrType
!= value.
ClrType
)
1289
throw Error.ArgumentWrongType("value", this.matchExpression.
ClrType
, value.
ClrType
);
1299
if (this.matchValue != null && this.matchValue.
ClrType
!= value.
ClrType
)
1300
throw Error.ArgumentWrongType("value", this.matchValue.
ClrType
, value.
ClrType
);
1337
if (this.discriminator != null && this.discriminator.
ClrType
!= value.
ClrType
)
1338
throw Error.ArgumentWrongType("value", this.discriminator.
ClrType
, value.
ClrType
);
1372
if (this.match != null && value != null && this.match.
ClrType
!= value.
ClrType
)
1373
throw Error.ArgumentWrongType("value", this.match.
ClrType
, value.
ClrType
);
1462
if (!this.member.ReflectedType.IsAssignableFrom(value.
ClrType
) &&
1463
!value.
ClrType
.IsAssignableFrom(this.member.ReflectedType))
1464
throw Error.MemberAccessIllegal(this.member, this.member.ReflectedType, value.
ClrType
);
1493
: this(expr.
ClrType
, expr.SqlType, name, null, expr, expr.SourceExpression) {
1525
if (!this.
ClrType
.IsAssignableFrom(value.
ClrType
))
1526
throw Error.ArgumentWrongType("value", this.
ClrType
, value.
ClrType
);
1547
: base(SqlNodeType.ColumnRef, col.
ClrType
, col.SourceExpression) {
1641
if (!this.key.
ClrType
.IsAssignableFrom(value.
ClrType
)
1642
&& !value.
ClrType
.IsAssignableFrom(this.key.
ClrType
))
1643
throw Error.ArgumentWrongType("value", this.key.
ClrType
, value.
ClrType
);
1653
if (value.
ClrType
!= this.group.
ClrType
)
1654
throw Error.ArgumentWrongType("value", this.group.
ClrType
, value.
ClrType
);
1752
if (value != null && !this.method.DeclaringType.IsAssignableFrom(value.
ClrType
))
1753
throw Error.ArgumentWrongType("value", this.method.DeclaringType, value.
ClrType
);
1901
: base(SqlNodeType.ClientQuery, subquery.
ClrType
, subquery.SqlType, subquery.SourceExpression) {
1910
if (value == null || (this.query != null && this.query.
ClrType
!= value.
ClrType
))
1911
throw Error.ArgumentWrongType(value, this.query.
ClrType
, value.
ClrType
);
1943
if (value == null || this.expression != null && this.expression.
ClrType
!= value.
ClrType
)
1944
throw Error.ArgumentWrongType(value, this.expression.
ClrType
, value.
ClrType
);
1954
if (value.
ClrType
!= typeof(int))
1955
throw Error.ArgumentWrongType(value, typeof(int), value.
ClrType
);
2018
if (!this.table.RowType.Type.IsAssignableFrom(value.
ClrType
))
2019
throw Error.ArgumentWrongType("value", this.table.RowType, value.
ClrType
);
2081
if (this.rightValue != null && !value.
ClrType
.IsAssignableFrom(this.rightValue.
ClrType
))
2082
throw Error.ArgumentWrongType("value", this.rightValue.
ClrType
, value.
ClrType
);
2092
if (this.leftValue != null && !this.leftValue.
ClrType
.IsAssignableFrom(value.
ClrType
))
2093
throw Error.ArgumentWrongType("value", this.leftValue.
ClrType
, value.
ClrType
);
2103
: base(SqlNodeType.DoNotVisit, expr.
ClrType
, expr.SourceExpression) {
2123
: base(SqlNodeType.OptionalValue, value.
ClrType
, value.SqlType, value.SourceExpression) {
2142
if (value.
ClrType
!= this.
ClrType
)
2143
throw Error.ArgumentWrongType("value", this.
ClrType
, value.
ClrType
);
2208
: base(SqlNodeType.SharedExpression, expr.
ClrType
, expr.SourceExpression) {
2217
if (!this.
ClrType
.IsAssignableFrom(value.
ClrType
)
2218
&& !value.
ClrType
.IsAssignableFrom(this.
ClrType
))
2219
throw Error.ArgumentWrongType("value", this.
ClrType
, value.
ClrType
);
2233
: base(SqlNodeType.SharedExpressionRef, expr.
ClrType
, expr.SourceExpression) {
2250
: base(SqlNodeType.SimpleExpression, expr.
ClrType
, expr.SourceExpression) {
2259
if (!TypeSystem.GetNonNullableType(this.
ClrType
).IsAssignableFrom(TypeSystem.GetNonNullableType(value.
ClrType
)))
2260
throw Error.ArgumentWrongType("value", this.
ClrType
, value.
ClrType
);
SqlClient\Query\LongTypeConverter.cs (1)
38
return sql.UnaryConvert(expr.
ClrType
, newType, expr, expr.SourceExpression);
SqlClient\Query\MethodCallConverter.cs (23)
97
return TypeSystem.IsNullableType(m.Expression.
ClrType
) && m.Member.Name == "Value";
101
return TypeSystem.IsNullableType(m.Expression.
ClrType
) && m.Member.Name == "HasValue";
165
SqlValue emptyStr = new SqlValue(strValue.
ClrType
, strValue.SqlType, String.Empty, strValue.IsClientSpecified, strValue.SourceExpression);
259
return sql.Binary(SqlNodeType.EQ, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.
ClrType
);
261
return sql.Binary(SqlNodeType.NE, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.
ClrType
);
263
return sql.Binary(SqlNodeType.LT, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.
ClrType
);
265
return sql.Binary(SqlNodeType.LE, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.
ClrType
);
267
return sql.Binary(SqlNodeType.GT, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.
ClrType
);
269
return sql.Binary(SqlNodeType.GE, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.
ClrType
);
271
return sql.Binary(SqlNodeType.Mul, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.
ClrType
);
273
return sql.Binary(SqlNodeType.Div, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.
ClrType
);
275
return sql.Binary(SqlNodeType.Sub, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.
ClrType
);
277
return sql.Binary(SqlNodeType.Add, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.
ClrType
);
279
return sql.Binary(SqlNodeType.Mod, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.
ClrType
);
281
return sql.Binary(SqlNodeType.BitAnd, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.
ClrType
);
283
return sql.Binary(SqlNodeType.BitOr, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.
ClrType
);
285
return sql.Binary(SqlNodeType.BitXor, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.
ClrType
);
314
if (mc.Arguments[1].
ClrType
== mc.Arguments[2].
ClrType
) {
326
throw Error.IifReturnTypesMustBeEqual(mc.Arguments[1].
ClrType
.Name, mc.Arguments[2].
ClrType
.Name);
332
Type treatType = t.
ClrType
;
333
Type originalType = model.GetMetaType(t.Operand.
ClrType
).InheritanceRoot.Type;
SqlClient\Query\QueryConverter.cs (14)
673
Expression.ArrayIndex(cpArray.Accessor.Body, Expression.Constant(vIndex.Value, vIndex.
ClrType
)),
699
SqlExpression datetime2 = new SqlVariable(expr.
ClrType
, expr.SqlType, "DATETIME2", expr.SourceExpression);
719
ConversionMethod cm = ChooseConversionMethod(expr.
ClrType
, type);
966
if (IsGrouping(selection.
ClrType
)) {
970
MetaTable table = this.services.Model.GetTable(selection.
ClrType
);
975
if (TypeSystem.IsSequenceType(selection.
ClrType
) && !selection.SqlType.CanBeColumn) {
1591
Type elementType = typeof(IGrouping<,>).MakeGenericType(keyExpr.
ClrType
, elemExpr.
ClrType
);
1613
Type elementType = typeof(IGrouping<,>).MakeGenericType(keyExpr.
ClrType
, elemExpr.
ClrType
);
1717
SqlColumn c = new SqlColumn(agg.
ClrType
, agg.SqlType, null, null, agg, this.dominatingExpression);
2383
SqlNodeType subType = (this.typeProvider.From(select.Selection.
ClrType
).CanBeColumn) ? SqlNodeType.ScalarSubSelect : SqlNodeType.Element;
2471
if (exp.
ClrType
!= id.Type) {
2755
this.AddIdentityMembers(select.Selection.
ClrType
.GetProperties());
SqlClient\Query\SqlBinder.cs (60)
178
if (this.IsConstNull(bo.Left) && !TypeSystem.IsNullableType(bo.
ClrType
)) {
181
else if (this.IsConstNull(bo.Right) && !TypeSystem.IsNullableType(bo.
ClrType
)) {
187
if (this.IsConstNull(bo.Left) && !TypeSystem.IsNullableType(bo.
ClrType
)) {
190
else if (this.IsConstNull(bo.Right) && !TypeSystem.IsNullableType(bo.
ClrType
)) {
215
return VisitUnaryOperator(new SqlUnary(negator, bo.
ClrType
, bo.SqlType, sql.DoNotVisitExpression(bo.Right), bo.SourceExpression));
217
if (bo.Right.
ClrType
==typeof(bool)) { // If the other side is nullable bool then this expression is already a reasonable way to handle three-values
224
return VisitUnaryOperator(new SqlUnary(negator, bo.
ClrType
, bo.SqlType, sql.DoNotVisitExpression(bo.Left), bo.SourceExpression));
226
if (bo.Left.
ClrType
==typeof(bool)) { // If the other side is nullable bool then this expression is already a reasonable way to handle three-values
315
if (typeof(Type).IsAssignableFrom(bo.Left.
ClrType
)) {
356
if (TypeSystem.IsSequenceType(bo.Left.
ClrType
)) {
357
throw Error.ComparisonNotSupportedForType(bo.Left.
ClrType
);
359
if (TypeSystem.IsSequenceType(bo.Right.
ClrType
)) {
360
throw Error.ComparisonNotSupportedForType(bo.Right.
ClrType
);
371
if (!typeof(Type).IsAssignableFrom(typeExpression.
ClrType
)) {
438
return sql.Case(tc.Discriminator.
ClrType
, tc.Discriminator, matches, values, tc.SourceExpression);
440
var mt = this.model.GetMetaType(obj.
ClrType
).InheritanceRoot;
445
return sql.TypedLiteralNull(dof.
ClrType
, dof.SourceExpression);
449
if ((c.
ClrType
== typeof(bool) || c.
ClrType
== typeof(bool?)) &&
490
if (!type.IsAssignableFrom(n.
ClrType
)) {
515
if (!type.IsAssignableFrom(expr.
ClrType
) && !expr.
ClrType
.IsAssignableFrom(type)) {
549
new SqlUnary(uo.NodeType, uo.
ClrType
, uo.SqlType,
550
new SqlUnary(SqlNodeType.OuterJoinedValue, ov.
ClrType
, ov.SqlType, ov.HasValue, ov.SourceExpression)
556
return new SqlUnary(uo.NodeType, uo.
ClrType
, uo.SqlType,
557
new SqlUnary(SqlNodeType.OuterJoinedValue, tc.Discriminator.
ClrType
, tc.Discriminator.SqlType, tc.Discriminator, tc.SourceExpression),
591
return sql.Value(uo.
ClrType
, uo.SqlType, DBConvert.ChangeType(val.Value, uo.
ClrType
), val.IsClientSpecified, val.SourceExpression);
630
return sql.Case(sc.
ClrType
, sc.Expression, matches, values, sc.SourceExpression);
638
SqlUnary un = new SqlUnary(uo.NodeType, uo.
ClrType
, uo.SqlType, when.TypeBinding, when.TypeBinding.SourceExpression);
646
return sql.Case(uo.
ClrType
, tc.Discriminator, newMatches, newValues, tc.SourceExpression);
655
return ApplyTreat(VisitExpression(uo.Operand), uo.
ClrType
);
716
newClrType = newValue.
ClrType
;
718
else if (newClrType != newValue.
ClrType
) {
719
throw Error.ExpectedClrTypesToAgree(newClrType, newValue.
ClrType
);
737
newClrType = newValue.
ClrType
;
739
else if (newClrType != newValue.
ClrType
) {
740
throw Error.ExpectedClrTypesToAgree(newClrType, newValue.
ClrType
);
769
if (m.Member.DeclaringType.IsAssignableFrom(sn.
ClrType
)) {
789
c = new SqlColumn(m.
ClrType
, sqlType, name, mm, null, m.SourceExpression);
804
c = new SqlColumn(m.
ClrType
, sqlType, name, mm, null, m.SourceExpression);
836
c = new SqlUserColumn(m.
ClrType
, sqlType, suq, name, mm.IsPrimaryKey, m.SourceExpression);
916
return sql.Value(m.
ClrType
, m.SqlType, null, val.IsClientSpecified, m.SourceExpression);
920
return sql.Value(m.
ClrType
, m.SqlType, p.GetValue(val.Value, null), val.IsClientSpecified, m.SourceExpression);
924
return sql.Value(m.
ClrType
, m.SqlType, f.GetValue(val.Value), val.IsClientSpecified, m.SourceExpression);
939
typeof(Func<,>).MakeGenericType(typeof(object[]), m.
ClrType
),
943
return new SqlClientParameter(m.
ClrType
, m.SqlType, accessor, cp.SourceExpression);
967
SqlSubSelect newss = sql.SubSelect(SqlNodeType.Multiset, sel, ss.
ClrType
);
1096
expr = new SqlColumn(expr.
ClrType
, expr.SqlType, null, null, expr, expr.SourceExpression);
1242
if (!sc.
ClrType
.IsAssignableFrom(when.Value.
ClrType
)) {
1243
throw Error.DidNotExpectTypeChange(when.Value.
ClrType
, sc.
ClrType
);
1302
if (!cc.
ClrType
.IsAssignableFrom(fetchedValue.
ClrType
)) {
1303
throw Error.DidNotExpectTypeChange(cc.
ClrType
, fetchedValue.
ClrType
);
1308
node = sql.Case(cc.
ClrType
, cc.Expression, matches, values, cc.SourceExpression);
1462
if (!TypeSystem.IsSequenceType(expr.
ClrType
)) {
1463
throw Error.SequenceOperatorsNotSupportedForType(expr.
ClrType
);
SqlClient\Query\SqlBooleanizer.cs (5)
41
valueExpression.
ClrType
, sql.TypeProvider.From(typeof(bool)),
61
SqlExpression valueNull = sql.Value(valueTrue.
ClrType
, valueTrue.SqlType, null, false, predicateExpression.SourceExpression);
63
predicateExpression.
ClrType
,
66
new SqlWhen(new SqlUnary(SqlNodeType.Not, predicateExpression.
ClrType
, predicateExpression.SqlType, predicateExpression, predicateExpression.SourceExpression), valueFalse)
74
predicateExpression.
ClrType
,
SqlClient\Query\SqlCaseSimplifier.cs (2)
124
rewrite = TryToWriteAsSimpleBooleanExpression(c.
ClrType
, c.Expression, newWhens, allValuesLiteral);
129
rewrite = TryToWriteAsReducedCase(c.
ClrType
, c.Expression, newWhens, c.Whens[compareWhen].Match, c.Whens.Count);
SqlClient\Query\SqlColumnizer.cs (1)
54
return new SqlColumn(expr.
ClrType
, expr.SqlType, null, null, expr, expr.SourceExpression);
SqlClient\Query\SqlComparer.cs (2)
97
return sun1.
ClrType
== sun2.
ClrType
&& sun1.SqlType == sun2.SqlType && AreEqual(sun1.Operand, sun2.Operand);
SqlClient\Query\SqlDeflator.cs (3)
295
if (c.
ClrType
!= cref.
ClrType
) {
296
c.SetClrType(cref.
ClrType
);
SqlClient\Query\SqlDuplicator.cs (29)
84
return new SqlRowNumber(rowNumber.
ClrType
, rowNumber.SqlType, orderBy, rowNumber.SourceExpression);
89
return new SqlBinary(bo.NodeType, bo.
ClrType
, bo.SqlType, left, right, bo.Method);
103
return new SqlJoinedCollection(jc.
ClrType
, jc.SqlType, this.VisitExpression(jc.Expression), this.VisitExpression(jc.Count), jc.SourceExpression);
110
return new SqlClientArray(scar.
ClrType
, scar.SqlType, exprs, scar.SourceExpression);
118
return new SqlTypeCase(tc.
ClrType
, tc.SqlType, tc.RowType, disc, whens, tc.SourceExpression);
136
SqlLink newLink = new SqlLink(new object(), link.RowType, link.
ClrType
, link.SqlType, null, link.Member, exprs, null, link.SourceExpression);
144
SqlColumn n = new SqlColumn(col.
ClrType
, col.SqlType, col.Name, col.MetaMember, null, col.SourceExpression);
163
return new SqlSubSelect(sqlExpr.NodeType, sqlExpr.
ClrType
, sqlExpr.SqlType, (SqlSelect)this.Visit(sqlExpr.Select));
182
return new SqlMember(m.
ClrType
, m.SqlType, (SqlExpression)this.Visit(m.Expression), m.Member);
188
return new SqlSubSelect(sms.NodeType, sms.
ClrType
, sms.SqlType, (SqlSelect)this.Visit(sms.Select));
191
SqlParameter n = new SqlParameter(p.
ClrType
, p.SqlType, p.Name, p.SourceExpression);
203
return new SqlSubSelect(SqlNodeType.ScalarSubSelect, ss.
ClrType
, ss.SqlType, this.VisitSequence(ss.Select));
261
SqlUserColumn dupSuc = new SqlUserColumn(suc.
ClrType
, suc.SqlType, suc.Query, suc.Name, suc.IsRequired, suc.SourceExpression);
285
return new SqlUserColumn(suc.
ClrType
, suc.SqlType, suc.Query, suc.Name, suc.IsRequired, suc.SourceExpression);
291
return new SqlUnary(SqlNodeType.Treat, t.
ClrType
, t.SqlType, (SqlExpression)this.Visit(t.Operand), t.SourceExpression);
294
return new SqlUnary(uo.NodeType, uo.
ClrType
, uo.SqlType, (SqlExpression)this.Visit(uo.Operand), uo.Method, uo.SourceExpression);
314
return new SqlSearchedCase(c.
ClrType
, whens, @else, c.SourceExpression);
323
return new SqlClientCase(c.
ClrType
, expr, whens, c.SourceExpression);
332
return new SqlSimpleCase(c.
ClrType
, expr, whens, c.SourceExpression);
342
return new SqlExprSet(xs.
ClrType
, exprs, xs.SourceExpression);
361
between.
ClrType
,
371
SqlIn nin = new SqlIn(sin.
ClrType
, sin.SqlType, this.VisitExpression(sin.Expression), sin.Values, sin.SourceExpression);
379
like.
ClrType
, like.SqlType,
391
return new SqlFunctionCall(fc.
ClrType
, fc.SqlType, fc.Name, args, fc.SourceExpression);
398
SqlTableValuedFunctionCall nfc = new SqlTableValuedFunctionCall(fc.RowType, fc.
ClrType
, fc.SqlType, fc.Name, args, fc.SourceExpression);
410
return new SqlMethodCall(mc.
ClrType
, mc.SqlType, mc.Method, this.VisitExpression(mc.Object), args, mc.SourceExpression);
429
SqlGrouping n = new SqlGrouping(g.
ClrType
, g.SqlType,
438
return new SqlLift(lift.
ClrType
, this.VisitExpression(lift.Expression), lift.SourceExpression);
441
return new SqlDiscriminatorOf(this.VisitExpression(dof.Object), dof.
ClrType
, dof.SqlType, dof.SourceExpression);
SqlClient\Query\SqlExpander.cs (4)
83
return new SqlLink(link.Id, link.RowType, link.
ClrType
, link.SqlType, link.Expression, link.Member, exprs, expansion, link.SourceExpression);
163
return new SqlClientCase(scs[0].
ClrType
, expression, whens, scs[0].SourceExpression);
195
return factory.TypeCase(tcs[0].
ClrType
, tcs[0].RowType, discriminator, whens, tcs[0].SourceExpression);
269
return new SqlLink(links[0].Id, links[0].RowType, links[0].
ClrType
, links[0].SqlType, links[0].Expression, links[0].Member, kexprs, expansion, links[0].SourceExpression);
SqlClient\Query\SqlFlattener.cs (5)
69
select.Selection = new SqlNop(select.Selection.
ClrType
, select.Selection.SqlType, select.SourceExpression);
144
c = new SqlColumn(expr.
ClrType
, expr.SqlType, name, null, expr, expr.SourceExpression);
176
if (TypeSystem.IsSequenceType(gex.
ClrType
)) {
177
throw Error.InvalidGroupByExpressionType(gex.
ClrType
.Name);
248
throw Error.InvalidOrderByExpression(obex.Expression.
ClrType
.Name);
SqlClient\Query\SqlFormatter.cs (1)
703
sb.Append(sox.
ClrType
.Name);
SqlClient\Query\SqlLiftIndependentRowExpressions.cs (1)
110
SqlSelect ns = new SqlSelect(new SqlNop(cols[0].
ClrType
, cols[0].SqlType, sqlSource.SourceExpression), sqlSource, sqlSource.SourceExpression);
SqlClient\Query\SqlMethodCallConverter.cs (94)
49
uo.
ClrType
== typeof(char) || uo.Operand.
ClrType
== typeof(char);
53
if (snew.
ClrType
== typeof(string)) {
56
else if (snew.
ClrType
== typeof(TimeSpan)) {
59
else if (snew.
ClrType
== typeof(DateTime)) {
66
return snew.Args.Count == 2 && snew.Args[0].
ClrType
== typeof(char) && snew.Args[1].
ClrType
== typeof(int);
70
if (sox.
ClrType
== typeof(DateTime)
72
&& sox.Args[0].
ClrType
== typeof(int)
73
&& sox.Args[1].
ClrType
== typeof(int)
74
&& sox.Args[2].
ClrType
== typeof(int)) {
79
sox.Args[3].
ClrType
== typeof(int) && sox.Args[4].
ClrType
== typeof(int) && sox.Args[5].
ClrType
== typeof(int)) {
83
if ((sox.Args.Count == 7) && (sox.Args[6].
ClrType
== typeof(int))) {
205
if (mc.Method.Name == "GetValueOrDefault" && TypeSystem.IsNullableType(mc.Object.
ClrType
)) {
257
if (mc.Arguments.Count == 1 && mc.Arguments[0].
ClrType
== typeof(TimeSpan)) {
281
if (mc.Arguments.Count == 1 && mc.Arguments[0].
ClrType
== typeof(TimeSpan)) {
321
if (mc.Arguments[0].
ClrType
== typeof(string) || mc.Arguments[0].
ClrType
== typeof(DateTime)) {
453
if (mc.Arguments[mc.Arguments.Count - 1].
ClrType
== typeof(MidpointRounding)
530
return m.Expression.
ClrType
== typeof(string) && m.Member.Name == "Length";
534
return m.Expression.
ClrType
== typeof(Binary) && m.Member.Name == "Length";
554
if (m.Expression.
ClrType
== typeof(DateTime)) {
573
if (m.Expression.
ClrType
== typeof(DateTimeOffset)) {
590
if (m.Expression.
ClrType
== typeof(TimeSpan)) {
652
Type newType = uo.
ClrType
;
654
if (newType == typeof(char) || expr.
ClrType
== typeof(char)) {
665
Type leftType = TypeSystem.GetNonNullableType(bo.Left.
ClrType
);
695
return sql.Case(tc.
ClrType
, tc.Discriminator, matches, values, tc.SourceExpression);
702
if (sox.
ClrType
== typeof(string)) {
705
else if (sox.
ClrType
== typeof(TimeSpan)) {
708
else if (sox.
ClrType
== typeof(DateTime)) {
711
else if (sox.
ClrType
== typeof(DateTimeOffset)) {
720
if (sox.
ClrType
== typeof(string) && sox.Args.Count == 2
721
&& sox.Args[0].
ClrType
== typeof(char) && sox.Args[1].
ClrType
== typeof(int)) {
732
if (sox.
ClrType
== typeof(DateTime) && sox.Args.Count >= 3 &&
733
sox.Args[0].
ClrType
== typeof(int) && sox.Args[1].
ClrType
== typeof(int) && sox.Args[2].
ClrType
== typeof(int)) {
745
sox.Args[3].
ClrType
== typeof(int) && sox.Args[4].
ClrType
== typeof(int) && sox.Args[5].
ClrType
== typeof(int)) {
758
if ((sox.Args.Count == 7) && (sox.Args[6].
ClrType
== typeof(int))) {
783
if (sox.
ClrType
== typeof(DateTimeOffset)) {
786
if (sox.Args.Count == 1 && sox.Args[0].
ClrType
== typeof(DateTime)) {
793
if (sox.Args.Count == 2 && sox.Args[0].
ClrType
== typeof(DateTime) && sox.Args[1].
ClrType
== typeof(TimeSpan)) {
805
sox.Args[0].
ClrType
== typeof(int) && sox.Args[1].
ClrType
== typeof(int) && sox.Args[2].
ClrType
== typeof(int) &&
806
sox.Args[3].
ClrType
== typeof(int) && sox.Args[4].
ClrType
== typeof(int) && sox.Args[5].
ClrType
== typeof(int)) {
830
if (sox.Args.Count == 7 && sox.Args[6].
ClrType
== typeof(TimeSpan)) {
835
else if (sox.Args.Count == 8 && sox.Args[6].
ClrType
== typeof(int) && sox.Args[7].
ClrType
== typeof(TimeSpan)) {
909
returnValue = sql.ConvertTo(mc.
ClrType
, mc.Arguments[0]);
1000
System.Type clrType = mc.Object.
ClrType
.GetGenericArguments()[0];
1059
else if ((mc.Method.Name == "Add" && mc.Arguments.Count == 1 && mc.Arguments[0].
ClrType
== typeof(TimeSpan))
1121
else if ((mc.Method.Name == "Add" && mc.Arguments.Count == 1 && mc.Arguments[0].
ClrType
== typeof(TimeSpan))
1222
Type nnType = TypeSystem.GetNonNullableType(expr.
ClrType
);
1262
(expr.
ClrType
== typeof(bool) && targetType == typeof(int))) {
1271
else if (targetType != expr.
ClrType
&&
1272
(TypeSystem.GetNonNullableType(targetType) == TypeSystem.GetNonNullableType(expr.
ClrType
))) {
1285
bool resultNullable = TypeSystem.IsNullableType(bo.
ClrType
);
1286
Type rightType = TypeSystem.GetNonNullableType(bo.Right.
ClrType
);
1291
Type resultType = bo.
ClrType
;
1309
Debug.Assert(TypeSystem.GetNonNullableType(bo.Left.
ClrType
) == typeof(DateTimeOffset));
1311
Type resultType = bo.
ClrType
;
1363
return TypeSystem.GetNonNullableType(bo.Left.
ClrType
) == typeof(DateTimeOffset) ?
1380
} else if (TypeSystem.GetNonNullableType(bo.Left.
ClrType
) == typeof(DateTimeOffset)) {
1518
cp.
ClrType
, cp.SqlType,
1552
cp.
ClrType
, cp.SqlType,
1586
cp.
ClrType
, cp.SqlType,
1625
if (mc.Arguments[1].
ClrType
== typeof(StringComparison)) {
1646
if (mc.Arguments[2].
ClrType
== typeof(StringComparison)) {
1709
if (mc.Arguments[1].
ClrType
== typeof(StringComparison)) {
1745
if (mc.Arguments[2].
ClrType
== typeof(StringComparison)) {
1979
return sql.FunctionCall(mc.Arguments[0].
ClrType
, "ABS", new SqlExpression[] { mc.Arguments[0] }, source);
2009
return this.CreateFunctionCallStatic1(mc.Arguments[0].
ClrType
, "CEILING", mc.Arguments, source);
2034
return this.CreateFunctionCallStatic1(mc.Arguments[0].
ClrType
, "FLOOR", mc.Arguments, source);
2074
return this.CreateFunctionCallStatic2(mc.
ClrType
, "POWER", mc.Arguments, source);
2079
if ((mc.Arguments[nParams - 1].
ClrType
!= typeof(MidpointRounding))) {
2097
return sql.FunctionCall(x.
ClrType
, "round", new SqlExpression[] { x, i }, source);
2104
Type type = x.
ClrType
;
2168
Type baseClrTypeOfExpr = TypeSystem.GetNonNullableType(exp.
ClrType
);
2437
if ((targetType == typeof(int) || targetType == typeof(Single)) && expr.
ClrType
== typeof(bool)) {
2448
else if (mc.
ClrType
!= mc.Arguments[0].
ClrType
) {
2470
Debug.Assert(mc.Arguments[0].
ClrType
== typeof(string));
2471
Debug.Assert(mc.Arguments[1].
ClrType
== typeof(string));
2485
cp.
ClrType
, cp.SqlType,
SqlClient\Query\SqlMethodTransformer.cs (3)
42
resultFunctionCall.
ClrType
,
44
if ((resultFunctionCall.
ClrType
!= clrType) && !skipConversion) {
45
result = sql.ConvertTo(resultFunctionCall.
ClrType
, resultFunctionCall);
SqlClient\Query\SqlMultiplexer.cs (6)
68
SqlJoinedCollection jc = new SqlJoinedCollection(sms.
ClrType
, sms.SqlType, expr, count, sms.SourceExpression);
240
Type clrType = expr.
ClrType
;
241
if (expr.
ClrType
.IsValueType && !TypeSystem.IsNullableType(expr.
ClrType
)) {
242
clrType = typeof(Nullable<>).MakeGenericType(expr.
ClrType
);
258
return new SqlLink(new object(), link.RowType, link.
ClrType
, link.SqlType, null, link.Member, exprs, null, link.SourceExpression);
SqlClient\Query\SqlOuterApplyReducer.cs (2)
150
SqlSelect ns = new SqlSelect(new SqlNop(cols[0].
ClrType
, cols[0].SqlType, sqlSource.SourceExpression), sqlSource, sqlSource.SourceExpression);
370
this.lifted = new SqlBinary(SqlNodeType.And, this.lifted.
ClrType
, this.lifted.SqlType, this.lifted, select.Where);
SqlClient\Query\SqlParameterizer.cs (5)
116
p = new SqlParameter(cp.
ClrType
, cp.SqlType, this.parameterizer.CreateParameterName(), cp.SourceExpression);
120
p = new SqlParameter(cp.
ClrType
, this.timeProviderType, this.parameterizer.CreateParameterName(), cp.SourceExpression);
151
if (isLeftColRef && leftSqlDbType == SqlDbType.Time && bo.Right.
ClrType
== typeof(DateTime))
153
else if (isRightColRef && rightSqlDbType == SqlDbType.Time && bo.Left.
ClrType
== typeof(DateTime))
291
SqlParameter p = new SqlParameter(cp.
ClrType
, cp.SqlType, this.parameterizer.CreateParameterName(), cp.SourceExpression);
SqlClient\Query\SqlReorderer.cs (1)
263
SqlSelect select = new SqlSelect(new SqlNop(column.
ClrType
, column.SqlType, column.SourceExpression), this.currentSelect.From, this.currentSelect.SourceExpression);
SqlClient\Query\SqlResolver.cs (1)
255
SqlColumn c = new SqlColumn(found.
ClrType
, found.SqlType, name, this.found.MetaMember, new SqlColumnRef(this.found), row.SourceExpression);
SqlClient\Query\SqlRetyper.cs (23)
62
&& bo.Left.
ClrType
!=typeof(bool) && bo.Right.
ClrType
!=typeof(bool)) {
66
if (CanDbConvert(conv.Operand.
ClrType
, bo.Right.
ClrType
)
68
return VisitBinaryOperator(new SqlBinary(bo.NodeType, bo.
ClrType
, bo.SqlType, conv.Operand, bo.Right));
73
if (CanDbConvert(conv.Operand.
ClrType
, bo.Left.
ClrType
)
75
return VisitBinaryOperator(new SqlBinary(bo.NodeType, bo.
ClrType
, bo.SqlType, bo.Left, conv.Operand));
133
sin = new SqlIn(sin.
ClrType
, providerType, test, newValues, sin.SourceExpression);
172
when.Value = sql.UnaryConvert(when.Value.
ClrType
, type, when.Value, when.Value.SourceExpression);
176
c.Else = sql.UnaryConvert(c.Else.
ClrType
, type, c.Else, c.Else.SourceExpression);
194
when.Value = sql.UnaryConvert(when.Value.
ClrType
, type, when.Value, when.Value.SourceExpression);
230
arg1.
ClrType
, arg1.SqlType,
231
DBConvert.ChangeType(val.Value, arg1.
ClrType
),
238
arg2 = sql.UnaryConvert(arg1.
ClrType
, arg1.SqlType, arg2, arg2.SourceExpression);
253
if (arg1.
ClrType
!= typeof(bool) && arg2.
ClrType
!= typeof(bool)) {
304
arg2 = sql.UnaryConvert(arg1.
ClrType
, arg1.SqlType, arg2, arg2.SourceExpression);
307
arg1 = sql.UnaryConvert(arg2.
ClrType
, arg2.SqlType, arg1, arg1.SourceExpression);
315
if (!value.
ClrType
.IsAssignableFrom(expression.
ClrType
)) {
316
clrValue = DBConvert.ChangeType(clrValue, expression.
ClrType
);
319
return sql.Value(expression.
ClrType
, newSqlType, clrValue, value.IsClientSpecified, value.SourceExpression);
SqlClient\Query\SqlSupersetValidator.cs (6)
41
if (TypeSystem.GetNonNullableType(col.
ClrType
) != TypeSystem.GetNonNullableType(expr.
ClrType
)) {
57
&& value.
ClrType
.IsClass
58
&& value.
ClrType
!= typeof(string)
59
&& value.
ClrType
!= typeof(Type)
61
throw Error.ClassLiteralsNotAllowed(value.
ClrType
);
SqlClient\Query\SqlTopReducer.cs (1)
33
select.Top = sql.Value(val.
ClrType
, val.SqlType, val.Value, false, val.SourceExpression);
SqlClient\Query\SqlTypeConverter.cs (7)
78
Type oldClrType = TypeSystem.GetNonNullableType(uo.Operand.
ClrType
);
79
Type newClrType = TypeSystem.GetNonNullableType(uo.
ClrType
);
88
return sql.FunctionCall(uo.
ClrType
, "NCHAR", new SqlExpression[] { uo.Operand }, uo.SourceExpression);
94
uo.SetSqlType(sql.TypeProvider.From(uo.
ClrType
, oldSqlType.HasSizeOrIsLarge ? oldSqlType.Size : (int?)null));
105
return ConvertDoubleToString(uo.Operand, uo.
ClrType
);
108
return ConvertBitToString(uo.Operand, uo.
ClrType
);
112
uo.SetSqlType(sql.TypeProvider.From(uo.
ClrType
, oldSqlType.HasSizeOrIsLarge ? oldSqlType.Size : (int?)null));
SqlClient\Query\Translator.cs (2)
268
result = new SqlSubSelect(SqlNodeType.Multiset, link.
ClrType
, link.SqlType, sel);
271
result = new SqlSubSelect(SqlNodeType.Element, link.
ClrType
, link.SqlType, sel);
SqlClient\Query\TypeSource.cs (1)
40
Type type = sourceExpression.
ClrType
;
SqlClient\Reader\ObjectReaderCompiler.cs (60)
238
SqlColumn newcol = new SqlColumn(col.
ClrType
, col.SqlType, col.Name, col.MetaMember, null, col.SourceExpression);
250
SqlAlias newalias = new SqlAlias(new SqlNop(aref.
ClrType
, aref.SqlType, null));
473
node1.
ClrType
!= node2.
ClrType
||
805
return this.GenerateConstant(value.
ClrType
, value.Value);
826
System.Diagnostics.Debug.Assert(TypeSystem.IsNullableType(u.Operand.
ClrType
));
827
this.GenerateExpressionForType(u.Operand, u.Operand.
ClrType
);
828
LocalBuilder loc = gen.DeclareLocal(u.Operand.
ClrType
);
831
this.GenerateGetValue(u.Operand.
ClrType
);
832
return u.
ClrType
;
836
System.Diagnostics.Debug.Assert(opt.HasValue.
ClrType
== typeof(int?));
849
this.GenerateExpressionForType(opt.Value, opt.
ClrType
);
853
this.GenerateConstant(opt.
ClrType
, null);
856
return opt.
ClrType
;
860
return this.GenerateExpressionForType(lift.Expression, lift.
ClrType
);
864
if (!ca.
ClrType
.IsArray) {
865
throw Error.CannotMaterializeList(ca.
ClrType
);
867
Type elemType = TypeSystem.GetElementType(ca.
ClrType
);
876
return ca.
ClrType
;
882
this.GenerateExpressionForType(m.Expression, m.Expression.
ClrType
);
888
return this.GenerateMethodCall(new SqlMethodCall(m.
ClrType
, m.SqlType, pi.GetGetMethod(), m.Expression, null, m.SourceExpression));
895
Type actualType = this.GenerateExpressionForType(mc.Object, mc.Object.
ClrType
);
917
if (mc.Object != null && TypeSystem.IsNullableType(mc.Object.
ClrType
) && callOpCode == OpCodes.Callvirt){
918
gen.Emit(OpCodes.Constrained, mc.Object.
ClrType
);
933
LocalBuilder locInstance = gen.DeclareLocal(sn.
ClrType
);
951
else if (sn.
ClrType
.IsValueType) {
953
gen.Emit(OpCodes.Initobj, sn.
ClrType
);
956
ConstructorInfo ci = sn.
ClrType
.GetConstructor(System.Type.EmptyTypes);
972
LocalBuilder locCached = gen.DeclareLocal(sn.
ClrType
);
993
gen.Emit(OpCodes.Castclass, sn.
ClrType
);
1050
return sn.
ClrType
;
1346
Type[] typeArgs = grp.
ClrType
.GetGenericArguments();
1421
Type clientElementType = cq.Query.NodeType == SqlNodeType.Multiset ? TypeSystem.GetElementType(cq.
ClrType
) : cq.
ClrType
;
1434
Type clrType = cq.Arguments[i].
ClrType
;
1443
this.GenerateExpressionForType(cq.Arguments[i], cq.Arguments[i].
ClrType
);
1468
Type joinElementType = jc.Expression.
ClrType
;
1798
this.GenerateColumnAccess(cref.
ClrType
, cref.SqlType, cref.Column.Ordinal, null);
1799
return cref.
ClrType
;
1805
this.GenerateColumnAccess(suc.
ClrType
, suc.SqlType, 0, null);
1806
return suc.
ClrType
;
1828
this.GenerateColumnAccess(suc.
ClrType
, suc.SqlType, 0, locOrdinal);
1833
this.GenerateDefault(suc.
ClrType
, false);
1837
return suc.
ClrType
;
1905
LocalBuilder locDiscriminator = gen.DeclareLocal(scc.Expression.
ClrType
);
1906
this.GenerateExpressionForType(scc.Expression, scc.Expression.
ClrType
);
1919
this.GenerateExpressionForType(when.Match, scc.Expression.
ClrType
);
1927
this.GenerateExpressionForType(when.Value, scc.
ClrType
);
1933
return scc.
ClrType
;
1937
LocalBuilder locDiscriminator = gen.DeclareLocal(stc.Discriminator.
ClrType
);
1938
this.GenerateExpressionForType(stc.Discriminator, stc.Discriminator.
ClrType
);
1963
this.GenerateExpressionForType(when.TypeBinding, stc.
ClrType
);
1968
this.GenerateConstant(stc.
ClrType
, null);
1972
return stc.
ClrType
;
1976
System.Diagnostics.Debug.Assert(dt.
ClrType
== typeof(Type));
1978
LocalBuilder locDiscriminator = gen.DeclareLocal(dt.Discriminator.
ClrType
);
1979
this.GenerateExpressionForType(dt.Discriminator, dt.Discriminator.
ClrType
);
2038
this.GenerateExpressionForType(when.Value, ssc.
ClrType
);
2043
this.GenerateExpressionForType(ssc.Else, ssc.
ClrType
);
2046
return ssc.
ClrType
;
SqlClient\SqlProvider.cs (4)
970
Type clientElementType = cq.Query.NodeType == SqlNodeType.Multiset ? TypeSystem.GetElementType(cq.
ClrType
) : cq.
ClrType
;
1855
if (parameterValue != null && parameterValue.GetType() != pi.Parameter.
ClrType
) {
1856
return DBConvert.ChangeType(parameterValue, pi.Parameter.
ClrType
);