Exemple #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);
        }
 public override void Visit(CastCall node) { this.action(node); }
Exemple #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);
 }
Exemple #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;
        }
Exemple #6
0
 public override void Visit(CastCall node)
 {
     FindColumnReferences(node);
 }
Exemple #7
0
 public override void Visit(CastCall node)
 {
     VisitChildren(node);
 }