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