mardi 29 septembre 2015

MethodInfo's GetMethod for Dictionary objects's "Any" method [duplicate]

This question already has an answer here:

I am using below method to create the expression for searching a string in an entity

MethodInfo method = typeof(string).GetMethod("Contains", new[] { typeof(string) });

this works fine in the case of string. But when I tried with the Dictionary object as

MethodInfo method2 = typeof(Dictionary<string, string>).GetMethod("Any", new[] { typeof(Func<string,string>),typeof(bool)});

but it returns null value always. Anybody let me know how to use the method to get correct value of the MethodInfo





Aucun commentaire:

Enregistrer un commentaire