Ejemplo n.º 1
0
        private ScalarExpression GetColumnOrCastColumn(ColumnDescriptor column, string tableName)
        {
            var columnReference = new ColumnReferenceExpression();

            columnReference.MultiPartIdentifier = MultiPartIdentifierBuilder.Get(tableName, column.Name.GetName());

            if (column.UnderlyingType == "xml")
            {
                var cast = new CastCall();
                var type = new SqlDataTypeReference();
                type.SqlDataTypeOption = SqlDataTypeOption.NVarChar;
                type.Parameters.Add(new MaxLiteral());

                cast.DataType  = type;
                cast.Parameter = columnReference;
                return(cast);
            }

            return(columnReference);
        }
Ejemplo n.º 2
0
 public override void Visit(CastCall node) { this.action(node); }
Ejemplo n.º 3
0
 public override void ExplicitVisit(CastCall node)
 {
     base.ExplicitVisit(node);
     ReplaceExpression(node, n => n.Parameter);
 }
 public override void ExplicitVisit(CastCall fragment)
 {
     _fragments.Add(fragment);
 }
Ejemplo n.º 5
0
        private ScalarExpression GetColumnOrCastColumn(ColumnDescriptor column, string tableName)
        {
            var columnReference = new ColumnReferenceExpression();
            columnReference.MultiPartIdentifier = MultiPartIdentifierBuilder.Get(tableName, column.Name.GetName());

            if (column.UnderlyingType == "xml")
            {
                var cast = new CastCall();
                var type = new SqlDataTypeReference();
                type.SqlDataTypeOption = SqlDataTypeOption.NVarChar;
                type.Parameters.Add(new MaxLiteral());
                
                cast.DataType = type;
                cast.Parameter = columnReference;
                return cast;
            }

            return columnReference;
        }
Ejemplo n.º 6
0
 public override void Visit(CastCall node)
 {
     FindColumnReferences(node);
 }
Ejemplo n.º 7
0
 public override void Visit(CastCall node)
 {
     VisitChildren(node);
 }