EdmFunctions.Left Method (DbExpression, DbExpression)
Creates a DbFunctionExpression that invokes the canonical 'Left' function with the specified arguments, which must have a string and integer numeric result type. The result type of the expression is string.
Assembly: EntityFramework (in EntityFramework.dll)
public static DbFunctionExpression Left( this DbExpression stringArgument, DbExpression length )
Parameters
- stringArgument
-
Type:
System.Data.Entity.Core.Common.CommandTrees.DbExpression
An expression that specifies the string from which to extract the leftmost substring.
- length
-
Type:
System.Data.Entity.Core.Common.CommandTrees.DbExpression
An expression that specifies the length of the leftmost substring to extract from stringArgument.
Return Value
Type: System.Data.Entity.Core.Common.CommandTrees.DbFunctionExpressionA new DbFunctionExpression that returns the leftmost substring of length length from stringArgument.
Exception | Condition |
---|---|
ArgumentNullException | stringArgument or length is null. |
ArgumentException | No overload of the canonical 'Left' function accepts arguments with the result types of stringArgument. |