diff --git a/MoreLinq/ToDataTable.cs b/MoreLinq/ToDataTable.cs index 59a42b4fd..476fdb9bd 100644 --- a/MoreLinq/ToDataTable.cs +++ b/MoreLinq/ToDataTable.cs @@ -103,8 +103,8 @@ public static TTable ToDataTable(this IEnumerable source, TTable t expressions ??= EmptyArray>>.Value; var members = PrepareMemberInfos(expressions).ToArray(); - members = BuildOrBindSchema(table, members); - var shredder = CreateShredder(members); + var boundMembers = BuildOrBindSchema(table, members); + var shredder = CreateShredder(boundMembers); // // Builds rows out of elements in the sequence and @@ -180,7 +180,7 @@ static MemberInfo GetAccessedMember(LambdaExpression lambda) /// columns for which there is no source member supplying a value. /// - static MemberInfo[] BuildOrBindSchema(DataTable table, MemberInfo[] members) + static MemberInfo?[] BuildOrBindSchema(DataTable table, MemberInfo[] members) { // // Retrieve member information needed to @@ -227,7 +227,7 @@ var type when Nullable.GetUnderlyingType(type) is { } ut => ut, }; } - static Func CreateShredder(IEnumerable members) + static Func CreateShredder(MemberInfo?[] members) { var parameter = Expression.Parameter(typeof(T), "e");