DbFunctions.Truncate Method
When used as part of a LINQ to Entities query, this method invokes the canonical Truncate EDM function to truncate the given value to the number of specified digits.
Assembly: EntityFramework (in EntityFramework.dll)
Name | Description | |
---|---|---|
![]() ![]() | Truncate(Nullable<Decimal>, Nullable<Int32>) | When used as part of a LINQ to Entities query, this method invokes the canonical Truncate EDM function to truncate the given value to the number of specified digits. |
![]() ![]() | Truncate(Nullable<Double>, Nullable<Int32>) | When used as part of a LINQ to Entities query, this method invokes the canonical Truncate EDM function to truncate the given value to the number of specified digits. |
DbFunctions.Truncate Method (Nullable<Decimal>, Nullable<Int32>)
When used as part of a LINQ to Entities query, this method invokes the canonical Truncate EDM function to truncate the given value to the number of specified digits.
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "digits")] [DbFunctionAttribute("Edm", "Truncate")] [SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "value")] public static Nullable<decimal> Truncate( Nullable<decimal> value, Nullable<int> digits )
Parameters
- value
-
Type:
System.Nullable<Decimal>
The value to truncate.
- digits
-
Type:
System.Nullable<Int32>
The number of digits to preserve.
You cannot call this function directly. This function can only appear within a LINQ to Entities query. This function is translated to a corresponding function in the database.
DbFunctions.Truncate Method (Nullable<Double>, Nullable<Int32>)
When used as part of a LINQ to Entities query, this method invokes the canonical Truncate EDM function to truncate the given value to the number of specified digits.
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "value")] [DbFunctionAttribute("Edm", "Truncate")] [SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "digits")] public static Nullable<double> Truncate( Nullable<double> value, Nullable<int> digits )
Parameters
- value
-
Type:
System.Nullable<Double>
The value to truncate.
- digits
-
Type:
System.Nullable<Int32>
The number of digits to preserve.
You cannot call this function directly. This function can only appear within a LINQ to Entities query. This function is translated to a corresponding function in the database.