@@ -35,6 +35,37 @@ public void Should_Work_With_Null_Id()
3535 original . Should ( ) . HaveSameCount ( dtos ) ;
3636 }
3737
38+
39+ [ Fact ]
40+ public void Should_Work_With_Multiple_Null_Id ( )
41+ {
42+ Mapper . Reset ( ) ;
43+ Mapper . Initialize ( x =>
44+ {
45+ x . AddCollectionMappers ( ) ;
46+ x . CreateMap < ThingWithStringIdDto , ThingWithStringId > ( ) . EqualityComparison ( ( dto , entity ) => dto . ID == entity . ID ) ;
47+ } ) ;
48+
49+ var original = new List < ThingWithStringId >
50+ {
51+ new ThingWithStringId { ID = "1" , Title = "test0" } ,
52+ new ThingWithStringId { ID = "2" , Title = "test2" } ,
53+ new ThingWithStringId { ID = "3" , Title = "test3" } ,
54+ } ;
55+
56+ var dtos = new List < ThingWithStringIdDto >
57+ {
58+ new ThingWithStringIdDto { ID = "1" , Title = "test0" } ,
59+ new ThingWithStringIdDto { ID = "2" , Title = "test2" } ,
60+ new ThingWithStringIdDto { Title = "test3" } ,
61+ new ThingWithStringIdDto { Title = "test4" } ,
62+ } ;
63+
64+ Mapper . Map ( dtos , original ) ;
65+
66+ original . Should ( ) . HaveSameCount ( dtos ) ;
67+ }
68+
3869 public class ThingWithStringId
3970 {
4071 public string ID { get ; set ; }
0 commit comments