@@ -58,7 +58,7 @@ private Mapper() {}
5858 /// <param name="splitOn">The field from which to split and read the second object.</param>
5959 /// <returns>The newly created object pair.</returns>
6060 /// <exception cref="InvalidOperationException">The split field could not be found.</exception>
61- public ( T , U ) CreateInstance < T , U > ( IDataRecord record , string splitOn = "Id" ) where T : new ( ) where U : new ( ) {
61+ public ( TItem1 , TItem2 ) CreateInstance < TItem1 , TItem2 > ( IDataRecord record , string splitOn = "Id" ) where TItem1 : new ( ) where TItem2 : new ( ) {
6262 var properties = new List < KeyValuePair < string , object ? > > ( record . FieldCount ) ;
6363 for ( var index = 0 ; index < record . FieldCount ; index ++ ) {
6464 var value = record [ index ] ;
@@ -71,8 +71,8 @@ private Mapper() {}
7171 var firstObject = properties . Take ( splitOnIndex ) . ToDictionary ( ) ;
7272 var secondObject = properties . Skip ( splitOnIndex ) . ToDictionary ( ) ;
7373 return (
74- firstObject . Values . All ( value => value is null ) ? default ! : CreateInstance < T > ( firstObject ) ,
75- secondObject . Values . All ( value => value is null ) ? default ! : CreateInstance < U > ( secondObject )
74+ firstObject . Values . All ( value => value is null ) ? default ! : CreateInstance < TItem1 > ( firstObject ) ,
75+ secondObject . Values . All ( value => value is null ) ? default ! : CreateInstance < TItem2 > ( secondObject )
7676 ) ;
7777 }
7878
@@ -132,8 +132,8 @@ private Mapper() {}
132132 /// <param name="reader">A data reader providing the properties to be set on the created objects.</param>
133133 /// <param name="splitOn">The field from which to split and read the second object.</param>
134134 /// <returns>An enumerable of newly created object pairs.</returns>
135- public IEnumerable < ( T , U ) > CreateInstances < T , U > ( IDataReader reader , string splitOn = "Id" ) where T : new ( ) where U : new ( ) {
136- while ( reader . Read ( ) ) yield return CreateInstance < T , U > ( reader , splitOn ) ;
135+ public IEnumerable < ( TItem1 , TItem2 ) > CreateInstances < TItem1 , TItem2 > ( IDataReader reader , string splitOn = "Id" ) where TItem1 : new ( ) where TItem2 : new ( ) {
136+ while ( reader . Read ( ) ) yield return CreateInstance < TItem1 , TItem2 > ( reader , splitOn ) ;
137137 reader . Close ( ) ;
138138 }
139139
0 commit comments