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); }
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); }
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())); }
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>()); }
private void TestConst(SqlXml x) { _SqlXml column = _SqlXml.Const(x); column.VerifyConst(x); }
private void TestImplicit(SqlXml x) { _SqlXml column = x; column.VerifyParam(x); }
/// <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>()); }