Example:
public static TResult Blabla<T, TResult>(this T value, Func<T, TResult> function) => function(value); var blub = "Hi;This;Is;Me"; var huhu = blub.Split(';').Blabla(x=> new { Name = x[3], Description = x[1] }).CreateType<ISpecial>();
CreateType should check for generic resturn type on "Blabla" call and use this to create the anonymous type.
The current implementation also does not consider static methods.
Example:
public static TResult Blabla<T, TResult>(this T value, Func<T, TResult> function) => function(value);
var blub = "Hi;This;Is;Me"; var huhu = blub.Split(';').Blabla(x=> new { Name = x[3], Description = x[1] }).CreateType<ISpecial>();
CreateType should check for generic resturn type on "Blabla" call and use this to create the anonymous type. The current implementation also does not consider static methods.