@@ -48,14 +48,14 @@ internal static List<MiniExcelColumnMapping> GetMappingsForImport(Type type, str
4848
4949 private static List < MiniExcelColumnMapping ? > GetMappingsForExport ( this Type type , MiniExcelBaseConfiguration configuration )
5050 {
51- var props = GetColumnMappings ( type , ExportMembersFlags , configuration )
51+ var mappings = GetColumnMappings ( type , ExportMembersFlags , configuration )
5252 . Where ( prop => prop ? . MemberAccessor . CanRead is true )
5353 . ToList ( ) ;
5454
55- if ( props . Count == 0 )
55+ if ( mappings . Count == 0 )
5656 throw new InvalidMappingException ( $ "{ type . Name } must contain at least one mappable property or field.", type ) ;
5757
58- return SortMappings ( props ) ;
58+ return SortMappings ( mappings ) ;
5959 }
6060
6161 private static List < MiniExcelColumnMapping ? > SortMappings ( List < MiniExcelColumnMapping ? > mappings )
@@ -81,29 +81,29 @@ internal static List<MiniExcelColumnMapping> GetMappingsForImport(Type type, str
8181 if ( explicitIndexMappings . Count != 0 )
8282 maxColumnIndex = Math . Max ( explicitIndexMappings . Max ( w => w ? . ExcelColumnIndex ?? 0 ) , maxColumnIndex ) ;
8383
84- var withoutCustomIndexProps = mappings
84+ var mappingsWithoutCustomIndex = mappings
8585 . Where ( w => w ? . ExcelColumnIndex is null or - 1 )
8686 . ToList ( ) ;
8787
8888 var index = 0 ;
89- var newProps = new List < MiniExcelColumnMapping ? > ( ) ;
89+ var newMappings = new List < MiniExcelColumnMapping ? > ( ) ;
9090 for ( int i = 0 ; i <= maxColumnIndex ; i ++ )
9191 {
9292 if ( explicitIndexMappings . SingleOrDefault ( s => s ? . ExcelColumnIndex == i ) is { } p1 )
9393 {
94- newProps . Add ( p1 ) ;
94+ newMappings . Add ( p1 ) ;
9595 }
9696 else
9797 {
98- var p2 = withoutCustomIndexProps . ElementAtOrDefault ( index ) ;
98+ var map = mappingsWithoutCustomIndex . ElementAtOrDefault ( index ) ;
9999
100- p2 ? . ExcelColumnIndex = i;
101- newProps . Add ( p2 ) ;
100+ map ? . ExcelColumnIndex = i;
101+ newMappings . Add ( map ) ;
102102
103103 index ++ ;
104104 }
105105 }
106- return newProps ;
106+ return newMappings ;
107107 }
108108
109109 private static IEnumerable < MiniExcelColumnMapping ? > GetColumnMappings ( Type type , BindingFlags bindingFlags , MiniExcelBaseConfiguration configuration )
@@ -156,23 +156,23 @@ internal static List<MiniExcelColumnMapping> GetMappingsForImport(Type type, str
156156
157157 private static List < MiniExcelColumnMapping ? > GetDictionaryColumnInfo ( IDictionary < string , object ? > ? dicString , IDictionary ? dic , MiniExcelBaseConfiguration configuration )
158158 {
159- var props = new List < MiniExcelColumnMapping ? > ( ) ;
159+ var mappings = new List < MiniExcelColumnMapping ? > ( ) ;
160160
161161 var keys = dicString ? . Keys . ToList ( )
162162 ?? dic ? . Keys
163163 ?? throw new InvalidOperationException ( ) ;
164164
165165 foreach ( var key in keys )
166166 {
167- SetDictionaryColumnInfo ( props , key , configuration ) ;
167+ SetDictionaryColumnInfo ( mappings , key , configuration ) ;
168168 }
169169
170- return SortMappings ( props ) ;
170+ return SortMappings ( mappings ) ;
171171 }
172172
173- private static void SetDictionaryColumnInfo ( List < MiniExcelColumnMapping ? > props , object key , MiniExcelBaseConfiguration configuration )
173+ private static void SetDictionaryColumnInfo ( List < MiniExcelColumnMapping ? > mappings , object key , MiniExcelBaseConfiguration configuration )
174174 {
175- var mapping = new MiniExcelColumnMapping
175+ var map = new MiniExcelColumnMapping
176176 {
177177 Key = key ,
178178 ExcelColumnName = key ? . ToString ( )
@@ -185,40 +185,40 @@ private static void SetDictionaryColumnInfo(List<MiniExcelColumnMapping?> props,
185185 var dynamicColumn = configuration . DynamicColumns . SingleOrDefault ( x => x . Key == key ? . ToString ( ) ) ;
186186 if ( dynamicColumn is not null )
187187 {
188- mapping . Nullable = true ;
188+ map . Nullable = true ;
189189
190190 if ( dynamicColumn is { Format : { } fmt , FormatId : var fmtId } )
191191 {
192- mapping . ExcelFormat = fmt ;
193- mapping . ExcelFormatId = fmtId ;
192+ map . ExcelFormat = fmt ;
193+ map . ExcelFormatId = fmtId ;
194194 }
195195
196196 if ( dynamicColumn . Aliases is { } aliases )
197- mapping . ExcelColumnAliases = aliases ;
197+ map . ExcelColumnAliases = aliases ;
198198
199199 if ( dynamicColumn . IndexName is { } idxName )
200- mapping . ExcelIndexName = idxName ;
200+ map . ExcelIndexName = idxName ;
201201
202202 if ( dynamicColumn . Name is { } colName )
203- mapping . ExcelColumnName = colName ;
203+ map . ExcelColumnName = colName ;
204204
205- mapping . ExcelColumnIndex = dynamicColumn . Index ;
206- mapping . ExcelColumnWidth = dynamicColumn . Width ;
207- mapping . ExcelHiddenColumn = dynamicColumn . Hidden ;
208- mapping . ExcelColumnType = dynamicColumn . Type ;
209- mapping . CustomFormatter = dynamicColumn . CustomFormatter ;
205+ map . ExcelColumnIndex = dynamicColumn . Index ;
206+ map . ExcelColumnWidth = dynamicColumn . Width ;
207+ map . ExcelHiddenColumn = dynamicColumn . Hidden ;
208+ map . ExcelColumnType = dynamicColumn . Type ;
209+ map . CustomFormatter = dynamicColumn . CustomFormatter ;
210210
211211 isIgnore = dynamicColumn . Ignore ;
212212 }
213213 }
214214
215215 if ( ! isIgnore )
216- props . Add ( mapping ) ;
216+ mappings . Add ( map ) ;
217217 }
218218
219- internal static bool TryGetColumnMappings ( Type ? type , MiniExcelBaseConfiguration configuration , out List < MiniExcelColumnMapping ? > props )
219+ internal static bool TryGetColumnMappings ( Type ? type , MiniExcelBaseConfiguration configuration , out List < MiniExcelColumnMapping ? > mappings )
220220 {
221- props = [ ] ;
221+ mappings = [ ] ;
222222
223223 // Unknown type
224224 if ( type is null )
@@ -230,7 +230,7 @@ internal static bool TryGetColumnMappings(Type? type, MiniExcelBaseConfiguration
230230 if ( ValueIsNeededToDetermineProperties ( type ) )
231231 return false ;
232232
233- props = type . GetMappingsForExport ( configuration ) ;
233+ mappings = type . GetMappingsForExport ( configuration ) ;
234234 return true ;
235235 }
236236
0 commit comments