This commit is contained in:
@@ -10828,10 +10828,27 @@ namespace DynamORM
|
|||||||
{
|
{
|
||||||
ParameterExpression param = Expression.Parameter(typeof(InvokeMemberBinder), "o");
|
ParameterExpression param = Expression.Parameter(typeof(InvokeMemberBinder), "o");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return Expression.Lambda<Func<InvokeMemberBinder, IList<Type>>>(
|
||||||
|
Expression.TypeAs(
|
||||||
|
Expression.Field(
|
||||||
|
Expression.TypeAs(param, binderType), "typeArguments"),
|
||||||
|
typeof(IList<Type>)), param).Compile();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
PropertyInfo prop = binderType.GetProperty("TypeArguments");
|
||||||
|
|
||||||
|
if (!prop.CanRead)
|
||||||
|
return null;
|
||||||
|
|
||||||
return Expression.Lambda<Func<InvokeMemberBinder, IList<Type>>>(
|
return Expression.Lambda<Func<InvokeMemberBinder, IList<Type>>>(
|
||||||
Expression.TypeAs(
|
Expression.TypeAs(
|
||||||
Expression.Field(
|
Expression.Property(
|
||||||
Expression.TypeAs(param, binderType), "typeArguments"),
|
Expression.TypeAs(param, binderType), prop.Name),
|
||||||
typeof(IList<Type>)), param).Compile();
|
typeof(IList<Type>)), param).Compile();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -10888,6 +10905,14 @@ namespace DynamORM
|
|||||||
// If this was a success get and return it's value
|
// If this was a success get and return it's value
|
||||||
if (field != null)
|
if (field != null)
|
||||||
return field.GetValue(binder) as IList<Type>;
|
return field.GetValue(binder) as IList<Type>;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PropertyInfo prop = binder.GetType().GetProperty("TypeArguments");
|
||||||
|
|
||||||
|
// If we have a property, return it's value
|
||||||
|
if (prop != null)
|
||||||
|
return prop.GetValue(binder, null) as IList<Type>;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user