EdmFunctions.Replace Method (DbExpression, DbExpression, DbExpression)
Creates a DbFunctionExpression that invokes the canonical 'Replace' function with the specified arguments, which must each have a string result type. The result type of the expression is also string.
Assembly: EntityFramework (in EntityFramework.dll)
public static DbFunctionExpression Replace( this DbExpression stringArgument, DbExpression toReplace, DbExpression replacement )
Parameters
- stringArgument
-
Type:
System.Data.Entity.Core.Common.CommandTrees.DbExpression
An expression that specifies the string in which to perform the replacement operation.
- toReplace
-
Type:
System.Data.Entity.Core.Common.CommandTrees.DbExpression
An expression that specifies the string to replace.
- replacement
-
Type:
System.Data.Entity.Core.Common.CommandTrees.DbExpression
An expression that specifies the replacement string.
Return Value
Type: System.Data.Entity.Core.Common.CommandTrees.DbFunctionExpressionA new DbFunctionExpression than returns a new string based on stringArgument where every occurrence of toReplace is replaced by replacement.
Exception | Condition |
---|---|
ArgumentNullException | stringArgument, toReplace or replacement is null. |
ArgumentException | No overload of the canonical 'Replace' function accepts arguments with the result types of stringArgument, toReplace and replacement. |