예제 #1
0
            private SqlExpression ExtractParameter(SqlExpression expr)
            {
                Type clrType = expr.ClrType;

                if (expr.ClrType.IsValueType && !TypeSystem.IsNullableType(expr.ClrType))
                {
                    clrType = typeof(Nullable <>).MakeGenericType(expr.ClrType);
                }
                this.externals.Add(expr);
                SqlParameter sp = new SqlParameter(clrType, expr.SqlType, "@x" + (this.parameters.Count + 1), expr.SourceExpression);

                this.parameters.Add(sp);
                return(sp);
            }
예제 #2
0
 private static bool IsNullableHasValue(SqlMember m)
 {
     return(TypeSystem.IsNullableType(m.Expression.ClrType) && m.Member.Name == "HasValue");
 }