File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -183,12 +183,9 @@ private static IEnumerable<ExcelColumnInfo> ConvertToExcelCustomPropertyInfo(Pro
183183 var excludeNullableType = gt ?? p . PropertyType ;
184184 var excelFormat = p . GetAttribute < ExcelFormatAttribute > ( ) ? . Format ;
185185 var excelColumn = p . GetAttribute < ExcelColumnAttribute > ( ) ;
186- if ( configuration . DynamicColumns != null && configuration . DynamicColumns . Length > 0 )
187- {
188- var dynamicColumn = configuration . DynamicColumns . SingleOrDefault ( _ => _ . Key == p . Name ) ;
189- if ( dynamicColumn != null )
190- excelColumn = dynamicColumn ;
191- }
186+ var dynamicColumn = configuration ? . DynamicColumns ? . SingleOrDefault ( _ => _ . Key == p . Name ) ;
187+ if ( dynamicColumn != null )
188+ excelColumn = dynamicColumn ;
192189
193190 var ignore = p . GetAttributeValue ( ( ExcelIgnoreAttribute x ) => x . ExcelIgnore ) || p . GetAttributeValue ( ( ExcelColumnAttribute x ) => x . Ignore ) || ( excelColumn != null && excelColumn . Ignore ) ;
194191 if ( ignore )
@@ -209,7 +206,8 @@ private static IEnumerable<ExcelColumnInfo> ConvertToExcelCustomPropertyInfo(Pro
209206 ExcelColumnWidth = p . GetAttribute < ExcelColumnWidthAttribute > ( ) ? . ExcelColumnWidth ?? excelColumn ? . Width ,
210207 ExcelFormat = excelFormat ?? excelColumn ? . Format ,
211208 ExcelFormatId = excelColumn ? . FormatId ?? - 1 ,
212- ExcelColumnType = excelColumn ? . Type ?? ColumnType . Value
209+ ExcelColumnType = excelColumn ? . Type ?? ColumnType . Value ,
210+ CustomFormatter = dynamicColumn ? . CustomFormatter
213211 } ;
214212 } ) . Where ( _ => _ != null ) ;
215213 }
You can’t perform that action at this time.
0 commit comments