@@ -1574,15 +1574,16 @@ public virtual void Can_insert_and_read_back_all_mapped_data_types_with_scale()
1574
1574
var parameters = DumpParameters ( ) ;
1575
1575
Assert . Equal (
1576
1576
@"@p0='77'
1577
- @p1='2017-01-02T12:11:12.3210000' (Precision = 3)
1578
- @p2='2016-01-02T11:11:12.7650000+00:00' (Precision = 3)
1577
+ @p1='2017-01-02T12:11:12.3210000' (Scale = 3)
1578
+ @p2='2016-01-02T11:11:12.7650000+00:00' (Scale = 3)
1579
1579
@p3='102' (Precision = 3)
1580
1580
@p4='101' (Precision = 3)
1581
1581
@p5='103' (Precision = 3)
1582
1582
@p6='85.55000305175781' (Size = 25)
1583
1583
@p7='85.5' (Size = 3)
1584
1584
@p8='83.33000183105469' (Size = 25)
1585
- @p9='83.3' (Size = 3)" ,
1585
+ @p9='83.3' (Size = 3)
1586
+ @p10='12:34:56.7890123' (Scale = 3)" ,
1586
1587
parameters ,
1587
1588
ignoreLineEndingDifferences : true ) ;
1588
1589
@@ -1602,6 +1603,7 @@ private static void AssertMappedScaledDataTypes(MappedScaledDataTypes entity, in
1602
1603
Assert . Equal (
1603
1604
new DateTimeOffset ( new DateTime ( 2016 , 1 , 2 , 11 , 11 , 12 , 765 ) , TimeSpan . Zero ) , entity . DateTimeOffsetAsDatetimeoffset3 ) ;
1604
1605
Assert . Equal ( new DateTime ( 2017 , 1 , 2 , 12 , 11 , 12 , 321 ) , entity . DateTimeAsDatetime23 ) ;
1606
+ Assert . Equal ( TimeSpan . Parse ( "12:34:56.789" , System . Globalization . CultureInfo . InvariantCulture ) , entity . TimeSpanAsTime3 ) ;
1605
1607
Assert . Equal ( 101m , entity . DecimalAsDecimal3 ) ;
1606
1608
Assert . Equal ( 102m , entity . DecimalAsDec3 ) ;
1607
1609
Assert . Equal ( 103m , entity . DecimalAsNumeric3 ) ;
@@ -1619,7 +1621,8 @@ private static MappedScaledDataTypes CreateMappedScaledDataTypes(int id)
1619
1621
DateTimeAsDatetime23 = new DateTime ( 2017 , 1 , 2 , 12 , 11 , 12 , 321 ) ,
1620
1622
DecimalAsDecimal3 = 101m ,
1621
1623
DecimalAsDec3 = 102m ,
1622
- DecimalAsNumeric3 = 103m
1624
+ DecimalAsNumeric3 = 103m ,
1625
+ TimeSpanAsTime3 = TimeSpan . Parse ( "12:34:56.7890123" , System . Globalization . CultureInfo . InvariantCulture )
1623
1626
} ;
1624
1627
1625
1628
[ ConditionalFact ]
@@ -1635,15 +1638,16 @@ public virtual void Can_insert_and_read_back_all_mapped_data_types_with_scale_se
1635
1638
var parameters = DumpParameters ( ) ;
1636
1639
Assert . Equal (
1637
1640
@"@p0='77'
1638
- @p1='2017-01-02T12:11:12.3210000' (Precision = 3)
1639
- @p2='2016-01-02T11:11:12.7650000+00:00' (Precision = 3)
1641
+ @p1='2017-01-02T12:11:12.3210000' (Scale = 3)
1642
+ @p2='2016-01-02T11:11:12.7650000+00:00' (Scale = 3)
1640
1643
@p3='102' (Precision = 3)
1641
1644
@p4='101' (Precision = 3)
1642
1645
@p5='103' (Precision = 3)
1643
1646
@p6='85.55000305175781' (Size = 25)
1644
1647
@p7='85.5' (Size = 3)
1645
1648
@p8='83.33000183105469' (Size = 25)
1646
- @p9='83.3' (Size = 3)" ,
1649
+ @p9='83.3' (Size = 3)
1650
+ @p10='12:34:56.7890000' (Scale = 3)" ,
1647
1651
parameters ,
1648
1652
ignoreLineEndingDifferences : true ) ;
1649
1653
@@ -1666,6 +1670,7 @@ private static void AssertMappedScaledSeparatelyDataTypes(MappedScaledSeparately
1666
1670
Assert . Equal ( 101m , entity . DecimalAsDecimal3 ) ;
1667
1671
Assert . Equal ( 102m , entity . DecimalAsDec3 ) ;
1668
1672
Assert . Equal ( 103m , entity . DecimalAsNumeric3 ) ;
1673
+ Assert . Equal ( TimeSpan . Parse ( "12:34:56.789" , System . Globalization . CultureInfo . InvariantCulture ) , entity . TimeSpanAsTime3 ) ;
1669
1674
}
1670
1675
1671
1676
private static MappedScaledSeparatelyDataTypes CreateMappedScaledSeparatelyDataTypes ( int id )
@@ -1680,7 +1685,8 @@ private static MappedScaledSeparatelyDataTypes CreateMappedScaledSeparatelyDataT
1680
1685
DateTimeAsDatetime23 = new DateTime ( 2017 , 1 , 2 , 12 , 11 , 12 , 321 ) ,
1681
1686
DecimalAsDecimal3 = 101m ,
1682
1687
DecimalAsDec3 = 102m ,
1683
- DecimalAsNumeric3 = 103m
1688
+ DecimalAsNumeric3 = 103m ,
1689
+ TimeSpanAsTime3 = TimeSpan . Parse ( "12:34:56.789" , System . Globalization . CultureInfo . InvariantCulture )
1684
1690
} ;
1685
1691
1686
1692
[ ConditionalFact ]
@@ -2480,18 +2486,19 @@ public virtual void Can_insert_and_read_back_all_mapped_data_types_with_scale_wi
2480
2486
Assert . Equal ( 1 , context . SaveChanges ( ) ) ;
2481
2487
}
2482
2488
2483
- var parameters = DumpParameters ( ) ;
2489
+ var parameters = DumpParameters ( ) ;
2484
2490
Assert . Equal (
2485
- @"@p0='2017-01-02T12:11:12.1230000' (Precision = 3)
2486
- @p1='2016-01-02T11:11:12.5670000+00:00' (Precision = 3)
2491
+ @"@p0='2017-01-02T12:11:12.1230000' (Scale = 3)
2492
+ @p1='2016-01-02T11:11:12.5670000+00:00' (Scale = 3)
2487
2493
@p2='102' (Precision = 3)
2488
2494
@p3='101' (Precision = 3)
2489
2495
@p4='103' (Precision = 3)
2490
2496
@p5='85.55000305175781' (Size = 25)
2491
2497
@p6='85.5' (Size = 3)
2492
2498
@p7='83.33000183105469' (Size = 25)
2493
2499
@p8='83.3' (Size = 3)
2494
- @p9='77'" ,
2500
+ @p9='77'
2501
+ @p10='12:34:56.7890123' (Scale = 3)" ,
2495
2502
parameters ,
2496
2503
ignoreLineEndingDifferences : true ) ;
2497
2504
@@ -2514,6 +2521,7 @@ private static void AssertMappedScaledDataTypesWithIdentity(MappedScaledDataType
2514
2521
Assert . Equal ( 101m , entity . DecimalAsDecimal3 ) ;
2515
2522
Assert . Equal ( 102m , entity . DecimalAsDec3 ) ;
2516
2523
Assert . Equal ( 103m , entity . DecimalAsNumeric3 ) ;
2524
+ Assert . Equal ( TimeSpan . Parse ( "12:34:56.789" , System . Globalization . CultureInfo . InvariantCulture ) , entity . TimeSpanAsTime3 ) ;
2517
2525
}
2518
2526
2519
2527
private static MappedScaledDataTypesWithIdentity CreateMappedScaledDataTypesWithIdentity ( int id )
@@ -2528,7 +2536,8 @@ private static MappedScaledDataTypesWithIdentity CreateMappedScaledDataTypesWith
2528
2536
DateTimeAsDatetime23 = new DateTime ( 2017 , 1 , 2 , 12 , 11 , 12 , 123 ) ,
2529
2537
DecimalAsDecimal3 = 101m ,
2530
2538
DecimalAsDec3 = 102m ,
2531
- DecimalAsNumeric3 = 103m
2539
+ DecimalAsNumeric3 = 103m ,
2540
+ TimeSpanAsTime3 = TimeSpan . Parse ( "12:34:56.7890123" , System . Globalization . CultureInfo . InvariantCulture )
2532
2541
} ;
2533
2542
2534
2543
[ ConditionalFact ]
@@ -3232,6 +3241,7 @@ public virtual void Columns_have_expected_data_types()
3232
3241
MappedScaledDataTypes.FloatAsFloat25 ---> [float] [Precision = 53]
3233
3242
MappedScaledDataTypes.FloatAsFloat3 ---> [real] [Precision = 24]
3234
3243
MappedScaledDataTypes.Id ---> [int] [Precision = 10 Scale = 0]
3244
+ MappedScaledDataTypes.TimeSpanAsTime3 ---> [time] [Precision = 3]
3235
3245
MappedScaledDataTypesWithIdentity.DateTimeAsDatetime23 ---> [datetime2] [Precision = 3]
3236
3246
MappedScaledDataTypesWithIdentity.DateTimeOffsetAsDatetimeoffset3 ---> [datetimeoffset] [Precision = 3]
3237
3247
MappedScaledDataTypesWithIdentity.DecimalAsDec3 ---> [decimal] [Precision = 3 Scale = 0]
@@ -3243,6 +3253,7 @@ public virtual void Columns_have_expected_data_types()
3243
3253
MappedScaledDataTypesWithIdentity.FloatAsFloat3 ---> [real] [Precision = 24]
3244
3254
MappedScaledDataTypesWithIdentity.Id ---> [int] [Precision = 10 Scale = 0]
3245
3255
MappedScaledDataTypesWithIdentity.Int ---> [int] [Precision = 10 Scale = 0]
3256
+ MappedScaledDataTypesWithIdentity.TimeSpanAsTime3 ---> [time] [Precision = 3]
3246
3257
MappedScaledSeparatelyDataTypes.DateTimeAsDatetime23 ---> [datetime2] [Precision = 3]
3247
3258
MappedScaledSeparatelyDataTypes.DateTimeOffsetAsDatetimeoffset3 ---> [datetimeoffset] [Precision = 3]
3248
3259
MappedScaledSeparatelyDataTypes.DecimalAsDec3 ---> [decimal] [Precision = 3 Scale = 0]
@@ -3253,6 +3264,7 @@ public virtual void Columns_have_expected_data_types()
3253
3264
MappedScaledSeparatelyDataTypes.FloatAsFloat25 ---> [float] [Precision = 53]
3254
3265
MappedScaledSeparatelyDataTypes.FloatAsFloat3 ---> [real] [Precision = 24]
3255
3266
MappedScaledSeparatelyDataTypes.Id ---> [int] [Precision = 10 Scale = 0]
3267
+ MappedScaledSeparatelyDataTypes.TimeSpanAsTime3 ---> [time] [Precision = 3]
3256
3268
MappedSizedDataTypes.BytesAsBinary3 ---> [nullable binary] [MaxLength = 3]
3257
3269
MappedSizedDataTypes.BytesAsBinaryVarying3 ---> [nullable varbinary] [MaxLength = 3]
3258
3270
MappedSizedDataTypes.BytesAsVarbinary3 ---> [nullable varbinary] [MaxLength = 3]
@@ -4127,6 +4139,9 @@ protected class MappedScaledDataTypes
4127
4139
4128
4140
[ Column ( TypeName = "numeric(3)" ) ]
4129
4141
public decimal DecimalAsNumeric3 { get ; set ; }
4142
+
4143
+ [ Column ( TypeName = "time(3)" ) ]
4144
+ public TimeSpan TimeSpanAsTime3 { get ; set ; }
4130
4145
}
4131
4146
4132
4147
protected class MappedScaledSeparatelyDataTypes
@@ -4159,6 +4174,9 @@ protected class MappedScaledSeparatelyDataTypes
4159
4174
4160
4175
[ Column ( TypeName = "numeric" ) ]
4161
4176
public decimal DecimalAsNumeric3 { get ; set ; }
4177
+
4178
+ [ Column ( TypeName = "time(3)" ) ]
4179
+ public TimeSpan TimeSpanAsTime3 { get ; set ; }
4162
4180
}
4163
4181
4164
4182
protected class DoubleDataTypes
@@ -4611,6 +4629,9 @@ protected class MappedScaledDataTypesWithIdentity
4611
4629
4612
4630
[ Column ( TypeName = "numeric(3)" ) ]
4613
4631
public decimal DecimalAsNumeric3 { get ; set ; }
4632
+
4633
+ [ Column ( TypeName = "time(3)" ) ]
4634
+ public TimeSpan TimeSpanAsTime3 { get ; set ; }
4614
4635
}
4615
4636
4616
4637
protected class MappedPrecisionAndScaledDataTypesWithIdentity
0 commit comments