in .net core 2.1
this my code
//call class Expression 's method
public static MethodCallExpression Call(Expression instance, MethodInfo method, params Expression[] arguments);
//service code
var parameter = Expression.Parameter(typeof(T), "x")
var property = Expression.Property(parameter, "Name");
var value = Expression.Constant("xx");
var converted = Expression.Convert(value, property.Type);
var exp = Expression.Call(property, property.Type.GetMethod("Contains"), converted);
//then will throw Ambiguous match found exception
i found in .net core 2.1 has 4 mehods,in .net framework have 1 methos,how can i fix in .net core 2.1 ,run in .net framework it's ok
methods in .net core https://i.stack.imgur.com/vNcks.png
methods in .net framework https://i.stack.imgur.com/nTvEp.png
Aucun commentaire:
Enregistrer un commentaire