Share via


DbFunctions.Right Method

[This page is specific to the Entity Framework version 6. The latest version is available as the 'Entity Framework' NuGet package. For more information about Entity Framework, see msdn.com/data/ef.]

When used as part of a LINQ to Entities query, this method invokes the canonical Right EDM function to return a given number of the rightmost characters in a string.

Namespace:  System.Data.Entity
Assembly:  EntityFramework (in EntityFramework.dll)

Syntax

'Declaration
<SuppressMessageAttribute("Microsoft.Naming", "CA1720:IdentifiersShouldNotContainTypeNames", MessageId := "string")> _
<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId := "stringArgument")> _
<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId := "length")> _
<DbFunctionAttribute("Edm", "Right")> _
Public Shared Function Right ( _
    stringArgument As String, _
    length As Nullable(Of Long) _
) As String
'Usage
Dim stringArgument As String 
Dim length As Nullable(Of Long)
Dim returnValue As String 

returnValue = DbFunctions.Right(stringArgument, _
    length)
[SuppressMessageAttribute("Microsoft.Naming", "CA1720:IdentifiersShouldNotContainTypeNames", MessageId = "string")]
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "stringArgument")]
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "length")]
[DbFunctionAttribute("Edm", "Right")]
public static string Right(
    string stringArgument,
    Nullable<long> length
)
[SuppressMessageAttribute(L"Microsoft.Naming", L"CA1720:IdentifiersShouldNotContainTypeNames", MessageId = L"string")]
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA1801:ReviewUnusedParameters", MessageId = L"stringArgument")]
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA1801:ReviewUnusedParameters", MessageId = L"length")]
[DbFunctionAttribute(L"Edm", L"Right")]
public:
static String^ Right(
    String^ stringArgument, 
    Nullable<long long> length
)
[<SuppressMessageAttribute("Microsoft.Naming", "CA1720:IdentifiersShouldNotContainTypeNames", MessageId = "string")>]
[<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "stringArgument")>]
[<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "length")>]
[<DbFunctionAttribute("Edm", "Right")>]
static member Right : 
        stringArgument:string * 
        length:Nullable<int64> -> string
public static function Right(
    stringArgument : String, 
    length : Nullable<long>
) : String

Parameters

Return Value

Type: System.String
A string containing the number of characters asked for from the right of the input string.

Remarks

You cannot call this function directly. This function can only appear within a LINQ to Entities query. This function is translated to a corresponding function in the database.

See Also

Reference

DbFunctions Class

System.Data.Entity Namespace