DbFunctions.CreateDateTime-Methode
[Diese Seite bezieht sich auf Entity Framework Version 6. Die neueste Version ist als 'Entity Framework' NuGet-Paket verfügbar. Weitere Informationen zu Entity Framework finden Sie unter msdn.com/data/ef.]
Wenn sie als Teil einer LINQ to Entities-Abfrage verwendet wird, ruft diese Methode die kanonische "CreateDateTime"-EDM-Funktion auf, um ein neues DateTime-Objekt zu erstellen.
Namespace: System.Data.Entity
Assembly: EntityFramework (in EntityFramework.dll)
Syntax
'Declaration
<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId := "year")> _
<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId := "second")> _
<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId := "month")> _
<DbFunctionAttribute("Edm", "CreateDateTime")> _
<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId := "minute")> _
<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId := "day")> _
<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId := "hour")> _
Public Shared Function CreateDateTime ( _
year As Nullable(Of Integer), _
month As Nullable(Of Integer), _
day As Nullable(Of Integer), _
hour As Nullable(Of Integer), _
minute As Nullable(Of Integer), _
second As Nullable(Of Double) _
) As Nullable(Of DateTime)
'Usage
Dim year As Nullable(Of Integer)
Dim month As Nullable(Of Integer)
Dim day As Nullable(Of Integer)
Dim hour As Nullable(Of Integer)
Dim minute As Nullable(Of Integer)
Dim second As Nullable(Of Double)
Dim returnValue As Nullable(Of DateTime)
returnValue = DbFunctions.CreateDateTime(year, _
month, day, hour, minute, second)
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "year")]
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "second")]
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "month")]
[DbFunctionAttribute("Edm", "CreateDateTime")]
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "minute")]
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "day")]
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "hour")]
public static Nullable<DateTime> CreateDateTime(
Nullable<int> year,
Nullable<int> month,
Nullable<int> day,
Nullable<int> hour,
Nullable<int> minute,
Nullable<double> second
)
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA1801:ReviewUnusedParameters", MessageId = L"year")]
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA1801:ReviewUnusedParameters", MessageId = L"second")]
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA1801:ReviewUnusedParameters", MessageId = L"month")]
[DbFunctionAttribute(L"Edm", L"CreateDateTime")]
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA1801:ReviewUnusedParameters", MessageId = L"minute")]
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA1801:ReviewUnusedParameters", MessageId = L"day")]
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA1801:ReviewUnusedParameters", MessageId = L"hour")]
public:
static Nullable<DateTime> CreateDateTime(
Nullable<int> year,
Nullable<int> month,
Nullable<int> day,
Nullable<int> hour,
Nullable<int> minute,
Nullable<double> second
)
[<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "year")>]
[<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "second")>]
[<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "month")>]
[<DbFunctionAttribute("Edm", "CreateDateTime")>]
[<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "minute")>]
[<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "day")>]
[<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "hour")>]
static member CreateDateTime :
year:Nullable<int> *
month:Nullable<int> *
day:Nullable<int> *
hour:Nullable<int> *
minute:Nullable<int> *
second:Nullable<float> -> Nullable<DateTime>
public static function CreateDateTime(
year : Nullable<int>,
month : Nullable<int>,
day : Nullable<int>,
hour : Nullable<int>,
minute : Nullable<int>,
second : Nullable<double>
) : Nullable<DateTime>
Parameter
- year
Typ: System.Nullable<Int32>
Das Jahr.
- month
Typ: System.Nullable<Int32>
Der Monat (1-basiert).
- day
Typ: System.Nullable<Int32>
Der Tag (1-basiert).
- hour
Typ: System.Nullable<Int32>
Die Stunden.
- minute
Typ: System.Nullable<Int32>
Die Minuten.
- second
Typ: System.Nullable<Double>
Die Sekunden, bei Bedarf einschließlich der Bruchteile von Sekunden.
Rückgabewert
Typ: System.Nullable<DateTime>
Das neue Datum/die neue Uhrzeit.
Hinweise
Sie können diese Funktion nicht direkt aufrufen. Diese Funktion kann nur innerhalb einer LINQ to Entities-Abfrage vorkommen. Diese Funktion wird in eine entsprechende Funktion in der Datenbank übersetzt.