次の方法で共有


DbFunctions.Left メソッド

[このページは、Entity Framework 6 に関するページです。最新バージョンは、'Entity Framework' NuGet パッケージとして入手できます。Entity Framework の詳細については、msdn.com/data/ef を参照してください。]

LINQ to Entities クエリの一部として使用された場合、このメソッドは、文字列内の左端の文字を指定数返す Left EDM 正規関数を呼び出します。

名前空間:  System.Data.Entity
アセンブリ:  EntityFramework (EntityFramework.dll 内)

構文

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

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

パラメーター

戻り値

型 : System.String
入力文字列の左から要求された文字数を含む文字列。

解説

この関数を直接呼び出すことはできません。 この関数は、LINQ to Entities クエリ内でのみ使用できます。 この関数は、データベース内の対応する関数に変換されます。

参照

参照

DbFunctions クラス

System.Data.Entity 名前空間