SqlFunctions.DatePart Method
Returns an integer that represents the specified datepart of the specified date.
Assembly: EntityFramework.SqlServer (in EntityFramework.SqlServer.dll)
Name | Description | |
---|---|---|
![]() ![]() | DatePart(String, Nullable<DateTime>) | Returns an integer that represents the specified datepart of the specified date. |
![]() ![]() | DatePart(String, Nullable<DateTimeOffset>) | Returns an integer that represents the specified datepart of the specified date. |
![]() ![]() | DatePart(String, Nullable<TimeSpan>) | Returns an integer that represents the specified datepart of the specified date. |
![]() ![]() | DatePart(String, String) | Returns an integer that represents the specified datepart of the specified date. |
SqlFunctions.DatePart Method (String, Nullable<DateTime>)
Returns an integer that represents the specified datepart of the specified date.
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "date")] [SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "datePartArg")] [DbFunctionAttribute("SqlServer", "DATEPART")] public static Nullable<int> DatePart( string datePartArg, Nullable<DateTime> date )
Parameters
- datePartArg
-
Type:
System.String
The part of the date to return the value.
- date
-
Type:
System.Nullable<DateTime>
The date.
SqlFunctions.DatePart Method (String, Nullable<DateTimeOffset>)
Returns an integer that represents the specified datepart of the specified date.
[DbFunctionAttribute("SqlServer", "DATEPART")] [SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "date")] [SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "datePartArg")] public static Nullable<int> DatePart( string datePartArg, Nullable<DateTimeOffset> date )
Parameters
- datePartArg
-
Type:
System.String
The part of the date to return the value.
- date
-
Type:
System.Nullable<DateTimeOffset>
The date.
SqlFunctions.DatePart Method (String, Nullable<TimeSpan>)
Returns an integer that represents the specified datepart of the specified date.
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "date")] [DbFunctionAttribute("SqlServer", "DATEPART")] [SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "datePartArg")] public static Nullable<int> DatePart( string datePartArg, Nullable<TimeSpan> date )
Parameters
- datePartArg
-
Type:
System.String
The part of the date to return the value.
- date
-
Type:
System.Nullable<TimeSpan>
The date.
SqlFunctions.DatePart Method (String, String)
Returns an integer that represents the specified datepart of the specified date.
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "date")] [SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "datePartArg")] [DbFunctionAttribute("SqlServer", "DATEPART")] public static Nullable<int> DatePart( string datePartArg, string date )
Parameters
- datePartArg
-
Type:
System.String
The part of the date to return the value.
- date
-
Type:
System.String
The date.