Прочетете на английски Редактиране

Споделяне чрез


EdmFunctions.Replace(DbExpression, DbExpression, DbExpression) Method

Definition

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.

C#
public static System.Data.Common.CommandTrees.DbFunctionExpression Replace(this System.Data.Common.CommandTrees.DbExpression stringArgument, System.Data.Common.CommandTrees.DbExpression toReplace, System.Data.Common.CommandTrees.DbExpression replacement);

Parameters

stringArgument
DbExpression

An expression that specifies the string in which to perform the replacement operation.

toReplace
DbExpression

An expression that specifies the string that is replaced.

replacement
DbExpression

An expression that specifies the replacement string.

Returns

A new DbFunctionExpression than returns a new string based on stringArgument where every occurrence of toReplace is replaced by replacement.

Exceptions

stringArgument or toReplace or replacement is null.

stringArgument or toReplace or replacement is invalid.

Applies to

Продукт Версии
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1