You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because a string is an IEnumerable of char when having a result of type string results in:
System.AggregateException : One or more errors occurred. (Sequence contains no elements)
----> System.InvalidOperationException : Sequence contains no elements
on the internal results variable
The text was updated successfully, but these errors were encountered:
I can't create a branch/PR so here is the code change suggested:
static class ObjectExtensions
{
internal static DataTable ToDataTable(this object result, Type resultType) =>
(result is not string && result is IEnumerable results) ?
results.ToDataTable(resultType.GenericTypeArguments.Single()) :
new[] { result }.ToDataTable(resultType);
}
Because a string is an IEnumerable of char when having a result of type string results in:
System.AggregateException : One or more errors occurred. (Sequence contains no elements)
----> System.InvalidOperationException : Sequence contains no elements
on the internal results variable
The text was updated successfully, but these errors were encountered: