SqlFunctionExprExtensions
Class to provide extension methods for the SqlFunctionExpr AST
CastArgument
Description
Creates a copy of the current SqlFunctionExpr with the argument at the given index casted to the given type.
public static SqlFunctionExpr CastArgument(
this SqlFunctionExpr node,
int index,
SqlDataType type);
Parameters
node: The current SqlFunctionExpr.
index: The index of the argument to cast.
type: The type to use in the casting.
Returns
A new SqlFunctionExpr with the same name but with the specified argument casted.
CastArguments
Description
Creates a copy of the current SqlFunctionExpr with the arguments at the given indexes casted to the given types. Assumes indexes are within bounds of the argument list.
public static SqlFunctionExpr CastArguments(
this SqlFunctionExpr node,
int[] indexes,
SqlDataType[] types);
Parameters
node: The current SqlFunctionExpr.
indexes: The array of indexes of arguments to cast.
type: The array of types to cast each arguments.
Returns
A new SqlFunctionExpr with the same name but with arguments casted.
GetFunctionName
Description
Gets the name of the function as a string
public static string GetFunctionName(
this SqlFunctionExpr node);
Parameters
node: The current SqlFunctionExpr.
Returns
The name of the function as a string
RemoveArguments
Description
Creates a copy of the current SqlFunctionExpr without the specified arguments.
public static SqlFunctionExpr RemoveArguments(
this SqlFunctionExpr node,
params int[] indexesToRemove);
Parameters
node: The current SqlFunctionExpr.
indexesToRemove: 0-based indexes of argument to remove.
Returns
A new SqlFunctionExpr without the specified arguments.
RenameFunction
public static SqlFunctionExpr RenameFunction(
this SqlFunctionExpr node,
string newFunctionName);
Description
Creates a new SqlFunctionExpr with the given new name. Keeps the same arguments.
Parameters
node: The current SqlFunctionExpr.
newFunctionName: The new name for the function
Returns
A new SqlFunctionExpr with the given new name.
Last updated
Was this helpful?