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
パラメーター
- stringArgument
型 : System.String
入力文字列。
- length
型 : System.Nullable<Int64>
返される文字数。
戻り値
型 : System.String
入力文字列の左から要求された文字数を含む文字列。
解説
この関数を直接呼び出すことはできません。 この関数は、LINQ to Entities クエリ内でのみ使用できます。 この関数は、データベース内の対応する関数に変換されます。