SqlClient\Query\SqlBinder.cs (6)
430SqlExpression @default = sql.Value(discriminator.GetType(), tc.Whens[0].Match.SqlType, defaultType.InheritanceCode, true, tc.SourceExpression);
435values.Add(sql.Value(discriminator.GetType(), when.Match.SqlType, ((SqlValue)when.Match).Value, true, tc.SourceExpression));
557new SqlUnary(SqlNodeType.OuterJoinedValue, tc.Discriminator.ClrType, tc.Discriminator.SqlType, tc.Discriminator, tc.SourceExpression),
894SqlNodeType subType = (rexp is SqlTypeCase || !rexp.SqlType.CanBeColumn) ? SqlNodeType.Element : SqlNodeType.ScalarSubSelect;
1095if (expr.NodeType == SqlNodeType.Value && expr.SqlType.CanBeColumn) {
1096expr = new SqlColumn(expr.ClrType, expr.SqlType, null, null, expr, expr.SourceExpression);
SqlClient\Query\SqlBooleanizer.cs (3)
43sql.Value(typeof(bool), valueExpression.SqlType, true, false, valueExpression.SourceExpression)
61SqlExpression valueNull = sql.Value(valueTrue.ClrType, valueTrue.SqlType, null, false, predicateExpression.SourceExpression);
66new SqlWhen(new SqlUnary(SqlNodeType.Not, predicateExpression.ClrType, predicateExpression.SqlType, predicateExpression, predicateExpression.SourceExpression), valueFalse)
SqlClient\Query\SqlRetyper.cs (58)
32if (uo.NodeType != SqlNodeType.Convert && uo.Operand != null && uo.Operand.SqlType != null) {
33uo.SetSqlType(this.typeProvider.PredictTypeForUnary(uo.NodeType, uo.Operand.SqlType));
67&& conv.Operand.SqlType.ComparePrecedenceTo(bo.Right.SqlType) != 1) {
74&& conv.Operand.SqlType.ComparePrecedenceTo(bo.Left.SqlType) != 1) {
86bo.SetSqlType(typeProvider.PredictTypeForBinary(bo.NodeType, left.SqlType, right.SqlType));
94val.SqlType.IsUnicodeType && !expr.SqlType.IsUnicodeType;
122? value.SqlType
123: this.typeProvider.PredictTypeForBinary(SqlNodeType.EQ, value.SqlType, valueType);
132ProviderType providerType = this.typeProvider.PredictTypeForBinary(SqlNodeType.EQ, test.SqlType, valueType);
142if (!like.Expression.SqlType.IsUnicodeType && like.Pattern.SqlType.IsUnicodeType &&
152ss.SetSqlType(ss.Select.Selection.SqlType);
160ProviderType type = c.Whens[0].Value.SqlType;
162ProviderType whenType = c.Whens[i].Value.SqlType;
166ProviderType elseType = c.Else.SqlType;
171foreach (SqlWhen when in c.Whens.Where(w => w.Value.SqlType != type && !w.Value.SqlType.IsRuntimeOnlyType)) {
175if (c.Else != null && c.Else.SqlType != type && !c.Else.SqlType.IsRuntimeOnlyType) {
186ProviderType type = c.Whens[0].Value.SqlType;
188ProviderType whenType = c.Whens[i].Value.SqlType;
193foreach (SqlWhen when in c.Whens.Where(w => w.Value.SqlType != type && !w.Value.SqlType.IsRuntimeOnlyType)) {
213ProviderType oldType = fc.Arguments[0].SqlType;
226if (arg1.SqlType != null && arg2.SqlType != null) {
230arg1.ClrType, arg1.SqlType,
234} else if (arg2.NodeType == SqlNodeType.ClientParameter && arg2.SqlType != arg1.SqlType) {
236cp.SetSqlType(arg1.SqlType);
238arg2 = sql.UnaryConvert(arg1.ClrType, arg1.SqlType, arg2, arg2.SourceExpression);
245if (arg1.SqlType == null || arg2.SqlType == null) return;
247if (arg1.SqlType.IsSameTypeFamily(arg2.SqlType)) {
261if ((arg1.SqlType.HasPrecisionAndScale && arg2.SqlType.HasPrecisionAndScale && arg1.SqlType != arg2.SqlType) ||
263ProviderType best = typeProvider.GetBestType(arg1.SqlType, arg2.SqlType);
272SetSqlTypeIfSimpleExpression(arg2, arg1.SqlType);
275SetSqlTypeIfSimpleExpression(arg1, arg2.SqlType);
295else if (arg2.NodeType == SqlNodeType.ClientParameter && arg2.SqlType != arg1.SqlType) {
296((SqlClientParameter)arg2).SetSqlType(arg1.SqlType);
298else if (arg1.NodeType == SqlNodeType.ClientParameter && arg1.SqlType != arg2.SqlType) {
299((SqlClientParameter)arg1).SetSqlType(arg2.SqlType);
302int coercionPrecedence = arg1.SqlType.ComparePrecedenceTo(arg2.SqlType);
304arg2 = sql.UnaryConvert(arg1.ClrType, arg1.SqlType, arg2, arg2.SourceExpression);
307arg1 = sql.UnaryConvert(arg2.ClrType, arg2.SqlType, arg1, arg1.SourceExpression);
318ProviderType newSqlType = typeProvider.ChangeTypeFamilyTo(value.SqlType, expression.SqlType);