DbFunctions.Left, méthode
[Cette page concerne Entity Framework version 6. La dernière version est disponible sous le nom de package 'Entity Framework' NuGet. Pour plus d'informations sur Entity Framework, consultez msdn.com/data/ef.]
Lorsqu'elle est utilisée dans le cadre d'une requête LINQ to Entities, cette méthode appelle la fonction EDM canonique Left pour retourner le nombre donné de caractères le plus à gauche dans une chaîne.
Espace de noms : System.Data.Entity
Assembly : EntityFramework (dans EntityFramework.dll)
Syntaxe
'Déclaration
<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
'Utilisation
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
Paramètres
- stringArgument
Type : System.String
Chaîne d'entrée.
- length
Type : System.Nullable<Int64>
Nombre de caractères à retourner.
Valeur de retour
Type : System.String
Chaîne contenant le nombre de caractères demandés en partant de la gauche de la chaîne d'entrée.
Notes
Vous ne pouvez pas appeler directement cette fonction. Cette fonction peut s'afficher uniquement dans une requête LINQ to Entities. Cette fonction est traduite en une fonction correspondante dans la base de données.