@@ -1584,15 +1584,16 @@ public virtual void Can_insert_and_read_back_all_mapped_data_types_with_scale()
1584
1584
var parameters = DumpParameters ( ) ;
1585
1585
Assert . Equal (
1586
1586
@"@p0='77'
1587
- @p1='2017-01-02T12:11:12.3210000' (Precision = 3)
1588
- @p2='2016-01-02T11:11:12.7650000+00:00' (Precision = 3)
1587
+ @p1='2017-01-02T12:11:12.3210000' (Scale = 3)
1588
+ @p2='2016-01-02T11:11:12.7650000+00:00' (Scale = 3)
1589
1589
@p3='102' (Precision = 3)
1590
1590
@p4='101' (Precision = 3)
1591
1591
@p5='103' (Precision = 3)
1592
1592
@p6='85.55000305175781' (Size = 25)
1593
1593
@p7='85.5' (Size = 3)
1594
1594
@p8='83.33000183105469' (Size = 25)
1595
- @p9='83.3' (Size = 3)" ,
1595
+ @p9='83.3' (Size = 3)
1596
+ @p10='12:34:56.7890123' (Scale = 3)" ,
1596
1597
parameters ,
1597
1598
ignoreLineEndingDifferences : true ) ;
1598
1599
@@ -1612,6 +1613,7 @@ private static void AssertMappedScaledDataTypes(MappedScaledDataTypes entity, in
1612
1613
Assert . Equal (
1613
1614
new DateTimeOffset ( new DateTime ( 2016 , 1 , 2 , 11 , 11 , 12 , 765 ) , TimeSpan . Zero ) , entity . DateTimeOffsetAsDatetimeoffset3 ) ;
1614
1615
Assert . Equal ( new DateTime ( 2017 , 1 , 2 , 12 , 11 , 12 , 321 ) , entity . DateTimeAsDatetime23 ) ;
1616
+ Assert . Equal ( TimeSpan . Parse ( "12:34:56.789" , System . Globalization . CultureInfo . InvariantCulture ) , entity . TimeSpanAsTime3 ) ;
1615
1617
Assert . Equal ( 101m , entity . DecimalAsDecimal3 ) ;
1616
1618
Assert . Equal ( 102m , entity . DecimalAsDec3 ) ;
1617
1619
Assert . Equal ( 103m , entity . DecimalAsNumeric3 ) ;
@@ -1629,7 +1631,8 @@ private static MappedScaledDataTypes CreateMappedScaledDataTypes(int id)
1629
1631
DateTimeAsDatetime23 = new DateTime ( 2017 , 1 , 2 , 12 , 11 , 12 , 321 ) ,
1630
1632
DecimalAsDecimal3 = 101m ,
1631
1633
DecimalAsDec3 = 102m ,
1632
- DecimalAsNumeric3 = 103m
1634
+ DecimalAsNumeric3 = 103m ,
1635
+ TimeSpanAsTime3 = TimeSpan . Parse ( "12:34:56.7890123" , System . Globalization . CultureInfo . InvariantCulture )
1633
1636
} ;
1634
1637
1635
1638
[ ConditionalFact ]
@@ -1645,15 +1648,16 @@ public virtual void Can_insert_and_read_back_all_mapped_data_types_with_scale_se
1645
1648
var parameters = DumpParameters ( ) ;
1646
1649
Assert . Equal (
1647
1650
@"@p0='77'
1648
- @p1='2017-01-02T12:11:12.3210000' (Precision = 3)
1649
- @p2='2016-01-02T11:11:12.7650000+00:00' (Precision = 3)
1651
+ @p1='2017-01-02T12:11:12.3210000' (Scale = 3)
1652
+ @p2='2016-01-02T11:11:12.7650000+00:00' (Scale = 3)
1650
1653
@p3='102' (Precision = 3)
1651
1654
@p4='101' (Precision = 3)
1652
1655
@p5='103' (Precision = 3)
1653
1656
@p6='85.55000305175781' (Size = 25)
1654
1657
@p7='85.5' (Size = 3)
1655
1658
@p8='83.33000183105469' (Size = 25)
1656
- @p9='83.3' (Size = 3)" ,
1659
+ @p9='83.3' (Size = 3)
1660
+ @p10='12:34:56.7890000' (Scale = 3)" ,
1657
1661
parameters ,
1658
1662
ignoreLineEndingDifferences : true ) ;
1659
1663
@@ -1676,6 +1680,7 @@ private static void AssertMappedScaledSeparatelyDataTypes(MappedScaledSeparately
1676
1680
Assert . Equal ( 101m , entity . DecimalAsDecimal3 ) ;
1677
1681
Assert . Equal ( 102m , entity . DecimalAsDec3 ) ;
1678
1682
Assert . Equal ( 103m , entity . DecimalAsNumeric3 ) ;
1683
+ Assert . Equal ( TimeSpan . Parse ( "12:34:56.789" , System . Globalization . CultureInfo . InvariantCulture ) , entity . TimeSpanAsTime3 ) ;
1679
1684
}
1680
1685
1681
1686
private static MappedScaledSeparatelyDataTypes CreateMappedScaledSeparatelyDataTypes ( int id )
@@ -1690,7 +1695,8 @@ private static MappedScaledSeparatelyDataTypes CreateMappedScaledSeparatelyDataT
1690
1695
DateTimeAsDatetime23 = new DateTime ( 2017 , 1 , 2 , 12 , 11 , 12 , 321 ) ,
1691
1696
DecimalAsDecimal3 = 101m ,
1692
1697
DecimalAsDec3 = 102m ,
1693
- DecimalAsNumeric3 = 103m
1698
+ DecimalAsNumeric3 = 103m ,
1699
+ TimeSpanAsTime3 = TimeSpan . Parse ( "12:34:56.789" , System . Globalization . CultureInfo . InvariantCulture )
1694
1700
} ;
1695
1701
1696
1702
[ ConditionalFact ]
@@ -2492,16 +2498,17 @@ public virtual void Can_insert_and_read_back_all_mapped_data_types_with_scale_wi
2492
2498
2493
2499
var parameters = DumpParameters ( ) ;
2494
2500
Assert . Equal (
2495
- @"@p0='2017-01-02T12:11:12.1230000' (Precision = 3)
2496
- @p1='2016-01-02T11:11:12.5670000+00:00' (Precision = 3)
2501
+ @"@p0='2017-01-02T12:11:12.1230000' (Scale = 3)
2502
+ @p1='2016-01-02T11:11:12.5670000+00:00' (Scale = 3)
2497
2503
@p2='102' (Precision = 3)
2498
2504
@p3='101' (Precision = 3)
2499
2505
@p4='103' (Precision = 3)
2500
2506
@p5='85.55000305175781' (Size = 25)
2501
2507
@p6='85.5' (Size = 3)
2502
2508
@p7='83.33000183105469' (Size = 25)
2503
2509
@p8='83.3' (Size = 3)
2504
- @p9='77'" ,
2510
+ @p9='77'
2511
+ @p10='12:34:56.7890123' (Scale = 3)" ,
2505
2512
parameters ,
2506
2513
ignoreLineEndingDifferences : true ) ;
2507
2514
@@ -2524,6 +2531,7 @@ private static void AssertMappedScaledDataTypesWithIdentity(MappedScaledDataType
2524
2531
Assert . Equal ( 101m , entity . DecimalAsDecimal3 ) ;
2525
2532
Assert . Equal ( 102m , entity . DecimalAsDec3 ) ;
2526
2533
Assert . Equal ( 103m , entity . DecimalAsNumeric3 ) ;
2534
+ Assert . Equal ( TimeSpan . Parse ( "12:34:56.789" , System . Globalization . CultureInfo . InvariantCulture ) , entity . TimeSpanAsTime3 ) ;
2527
2535
}
2528
2536
2529
2537
private static MappedScaledDataTypesWithIdentity CreateMappedScaledDataTypesWithIdentity ( int id )
@@ -2538,7 +2546,8 @@ private static MappedScaledDataTypesWithIdentity CreateMappedScaledDataTypesWith
2538
2546
DateTimeAsDatetime23 = new DateTime ( 2017 , 1 , 2 , 12 , 11 , 12 , 123 ) ,
2539
2547
DecimalAsDecimal3 = 101m ,
2540
2548
DecimalAsDec3 = 102m ,
2541
- DecimalAsNumeric3 = 103m
2549
+ DecimalAsNumeric3 = 103m ,
2550
+ TimeSpanAsTime3 = TimeSpan . Parse ( "12:34:56.7890123" , System . Globalization . CultureInfo . InvariantCulture )
2542
2551
} ;
2543
2552
2544
2553
[ ConditionalFact ]
@@ -3242,6 +3251,7 @@ public virtual void Columns_have_expected_data_types()
3242
3251
MappedScaledDataTypes.FloatAsFloat25 ---> [float] [Precision = 53]
3243
3252
MappedScaledDataTypes.FloatAsFloat3 ---> [real] [Precision = 24]
3244
3253
MappedScaledDataTypes.Id ---> [int] [Precision = 10 Scale = 0]
3254
+ MappedScaledDataTypes.TimeSpanAsTime3 ---> [time] [Precision = 3]
3245
3255
MappedScaledDataTypesWithIdentity.DateTimeAsDatetime23 ---> [datetime2] [Precision = 3]
3246
3256
MappedScaledDataTypesWithIdentity.DateTimeOffsetAsDatetimeoffset3 ---> [datetimeoffset] [Precision = 3]
3247
3257
MappedScaledDataTypesWithIdentity.DecimalAsDec3 ---> [decimal] [Precision = 3 Scale = 0]
@@ -3253,6 +3263,7 @@ public virtual void Columns_have_expected_data_types()
3253
3263
MappedScaledDataTypesWithIdentity.FloatAsFloat3 ---> [real] [Precision = 24]
3254
3264
MappedScaledDataTypesWithIdentity.Id ---> [int] [Precision = 10 Scale = 0]
3255
3265
MappedScaledDataTypesWithIdentity.Int ---> [int] [Precision = 10 Scale = 0]
3266
+ MappedScaledDataTypesWithIdentity.TimeSpanAsTime3 ---> [time] [Precision = 3]
3256
3267
MappedScaledSeparatelyDataTypes.DateTimeAsDatetime23 ---> [datetime2] [Precision = 3]
3257
3268
MappedScaledSeparatelyDataTypes.DateTimeOffsetAsDatetimeoffset3 ---> [datetimeoffset] [Precision = 3]
3258
3269
MappedScaledSeparatelyDataTypes.DecimalAsDec3 ---> [decimal] [Precision = 3 Scale = 0]
@@ -3263,6 +3274,7 @@ public virtual void Columns_have_expected_data_types()
3263
3274
MappedScaledSeparatelyDataTypes.FloatAsFloat25 ---> [float] [Precision = 53]
3264
3275
MappedScaledSeparatelyDataTypes.FloatAsFloat3 ---> [real] [Precision = 24]
3265
3276
MappedScaledSeparatelyDataTypes.Id ---> [int] [Precision = 10 Scale = 0]
3277
+ MappedScaledSeparatelyDataTypes.TimeSpanAsTime3 ---> [time] [Precision = 3]
3266
3278
MappedSizedDataTypes.BytesAsBinary3 ---> [nullable binary] [MaxLength = 3]
3267
3279
MappedSizedDataTypes.BytesAsBinaryVarying3 ---> [nullable varbinary] [MaxLength = 3]
3268
3280
MappedSizedDataTypes.BytesAsVarbinary3 ---> [nullable varbinary] [MaxLength = 3]
@@ -4137,6 +4149,9 @@ protected class MappedScaledDataTypes
4137
4149
4138
4150
[ Column ( TypeName = "numeric(3)" ) ]
4139
4151
public decimal DecimalAsNumeric3 { get ; set ; }
4152
+
4153
+ [ Column ( TypeName = "time(3)" ) ]
4154
+ public TimeSpan TimeSpanAsTime3 { get ; set ; }
4140
4155
}
4141
4156
4142
4157
protected class MappedScaledSeparatelyDataTypes
@@ -4169,6 +4184,9 @@ protected class MappedScaledSeparatelyDataTypes
4169
4184
4170
4185
[ Column ( TypeName = "numeric" ) ]
4171
4186
public decimal DecimalAsNumeric3 { get ; set ; }
4187
+
4188
+ [ Column ( TypeName = "time(3)" ) ]
4189
+ public TimeSpan TimeSpanAsTime3 { get ; set ; }
4172
4190
}
4173
4191
4174
4192
protected class DoubleDataTypes
@@ -4621,6 +4639,9 @@ protected class MappedScaledDataTypesWithIdentity
4621
4639
4622
4640
[ Column ( TypeName = "numeric(3)" ) ]
4623
4641
public decimal DecimalAsNumeric3 { get ; set ; }
4642
+
4643
+ [ Column ( TypeName = "time(3)" ) ]
4644
+ public TimeSpan TimeSpanAsTime3 { get ; set ; }
4624
4645
}
4625
4646
4626
4647
protected class MappedPrecisionAndScaledDataTypesWithIdentity
0 commit comments