Home
Forums
New posts
Search forums
Articles
Latest reviews
Search resources
Members
Current visitors
Newsgroups
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
Newsgroups
Microsoft DotNet
Microsoft C# .NET
GetMethod causes Ambiquous match found exception
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Andrus, post: 10956358"] Class MyClass contains a number of FindAll() methods in parent classes: class MyClass: ActiveRecordBase<MyClass> {... } public abstract class ActiveRecordBase<T> : ActiveRecordBase { protected ActiveRecordBase(); public static T[] FindAll(); public static T[] FindAll(params ICriterion[] criteria); public static T[] FindAll(DetachedCriteria criteria, params Order[] orders); public static T[] FindAll(Order order, params ICriterion[] criteria); public static T[] FindAll(Order[] orders, params ICriterion[] criteria); .... } public abstract class ActiveRecordBase : ActiveRecordHooksBase { protected ActiveRecordBase(); protected internal static Array FindAll(Type targetType); protected internal static Array FindAll(Type targetType, params ICriterion[] criteria); protected internal static Array FindAll(Type targetType, DetachedCriteria detachedCriteria, params Order[] orders); protected internal static Array FindAll(Type targetType, Order[] orders, params ICriterion[] criteria); .... I need to invoke MyClass parameterless FindAll() method using Reflection. I tried the following code but GetMethod() returns Ambiquous match found exception. How to run parameterless FindAll() method ? How to add required method signature to GetMethod() parameters or other solution ? Type t = Type.GetType("MyClass, MyDll"); // this line causes Ambiquous match found exception : MethodInfo mi = t.GetMethod("FindAll", BindingFlags.Public | BindingFlags.FlattenHierarchy | BindingFlags.Static); IList<object> list = (IList<object>)mi.Invoke(null, null); Andrus [/QUOTE]
Verification
Post reply
Home
Forums
Newsgroups
Microsoft DotNet
Microsoft C# .NET
GetMethod causes Ambiquous match found exception
Top