Hello @StefH,
Is it possible to add a new overload to the existing "ToDynamicList" extension method which accepts an instance of a Type class in order to return a typed list?
This may also come as an enhancement to the library itself since most people use it for dynamic operations which they may only know the type of their data at runtime.
As a workaround for now I did the following which is a bit nasty but it is working:
var genericTypeArgument = resultProperty.GetType().GetTypeInfo().GenericTypeArguments[0];
var method = typeof(DynamicEnumerableExtensions).GetMethods().Where(x => x.Name == "ToDynamicList" && x.IsGenericMethod == true).First();
var dynamicQueriedResult = resultProperty.Where(filters);
resultProperty = method.MakeGenericMethod(genericTypeArgument).Invoke(dynamicQueriedResult, new object[] { dynamicQueriedResult});
Many Thanks!
Hello @StefH,
Is it possible to add a new overload to the existing "ToDynamicList" extension method which accepts an instance of a Type class in order to return a typed list?
This may also come as an enhancement to the library itself since most people use it for dynamic operations which they may only know the type of their data at runtime.
As a workaround for now I did the following which is a bit nasty but it is working:
Many Thanks!