IEnumerable<T>.Select ?

85 views
Skip to first unread message

Hendrik Grützmacher

unread,
Dec 12, 2023, 3:49:04 AM12/12/23
to Spring4D
hello,
with version 2 i finally started using spring4d. starting with collections i wonder if there is a direct way to use Select on IEnumerable<T>, not only via TEnumerable.Select ?
i saw old code from spring4d v1 where it was possible. maybe i just missed one unit ...
thank you

Stefan Glienke

unread,
Jan 16, 2024, 7:05:33 AMJan 16
to Spring4D
Unfortunately, interfaces cannot have methods with generic parameters such as Select which has to specify the target type of the performed transformation.
I experimented with an approach using a record instead of interfaces which enables methods with generic parameters but that turned out to cause a lot of trouble with the compiler producing lots of code bloat and skyrocketing compiletimes.

Reply all
Reply to author
Forward
0 new messages