Skip to content

Commit 1432452

Browse files
committed
Ensure explicit List conversion for dataTableColumns
Updated the assignment of `dataTableColumns` to explicitly convert the result of `typeGetter.GetDataColumnsForObject` into a `List<DataTableColumn>` using `.ToList()`. This change ensures compatibility and enables list-specific operations, improving code clarity and robustness.
1 parent 71cca64 commit 1432452

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Microsoft.PowerShell.ConsoleGuiTools/TypeGetter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ public static DataTable CastObjectsToTableView(List<PSObject> psObjects, bool al
393393

394394
// Get the columns using format view definitions
395395
var typeGetter = new TypeGetter();
396-
var dataTableColumns = typeGetter.GetDataColumnsForObject(psObjects, allProperties);
396+
List<DataTableColumn> dataTableColumns = typeGetter.GetDataColumnsForObject(psObjects, allProperties).ToList();
397397

398398
// Convert each object to a row
399399
var dataTableRows = new List<DataTableRow>();

0 commit comments

Comments
 (0)