Example #1
0
        private void TestCastToString(SqlXml x, string expectedValue)
        {
            _SqlXml column1 = x;
            _String expr    = (_String)column1;
            var     dbExpr  = (DbCastExpression)expr.DbExpression;

            dbExpr.Verify(column1, typeof(SqlXml), typeof(string));
            expr.VerifyEval(expectedValue);
        }
Example #2
0
        private void TestFromString(string x, SqlXml expectedValue)
        {
            _String column1 = x;
            _SqlXml expr    = (_SqlXml)column1;
            var     dbExpr  = (DbCastExpression)expr.DbExpression;

            dbExpr.Verify(column1, typeof(string), typeof(SqlXml));
            var result = expr.Eval();

            Assert.AreEqual(expectedValue == null ? null : expectedValue.Value, result == null ? null : result.Value);
        }
Example #3
0
 private static T _InvokeValue <T>(_SqlXml xmlColumn, string xPath, T asColumn)
     where T : Column, new()
 {
     return(ValueFunctionInvoker <T> .Singleton.Invoke(asColumn, xmlColumn, _String.Const(xPath).AsSqlVarCharMax()));
 }
Example #4
0
 private static TColumn _Value <TColumn, TValue>(TColumn targetColumn, _SqlXml xmlColumn, Column xPath)
     where TColumn : Column <TValue>, new()
 {
     return(new XmlValueFunction <TValue>(xmlColumn, xPath, targetColumn).MakeColumn <TColumn>());
 }
Example #5
0
        private void TestConst(SqlXml x)
        {
            _SqlXml column = _SqlXml.Const(x);

            column.VerifyConst(x);
        }
Example #6
0
        private void TestImplicit(SqlXml x)
        {
            _SqlXml column = x;

            column.VerifyParam(x);
        }
Example #7
0
 /// <summary>Creates a column of parameter expression.</summary>
 /// <param name="x">The value of the parameter expression.</param>
 /// <param name="sourceColumn">The value which will be passed to <see cref="DbParamExpression.SourceColumn"/>.</param>
 /// <returns>The column of parameter expression.</returns>
 public static _SqlXml Param(SqlXml x, _SqlXml sourceColumn = null)
 {
     return(new ParamExpression <SqlXml>(x, sourceColumn).MakeColumn <_SqlXml>());
 }