Support Overloaded GetEnumerator
ryanwilliams83 opened this issue · comments
Ryan Williams commented
I'm trying to use JsonSchema.FromType<System.DirectoryServices.AccountManagement.UserPrincipal>()
but it's throwing an InvalidOperationException.
I suspect the reason is that ArrayList.GetEnumerator has an overload which is not working with
https://github.com/RicoSuter/Namotion.Reflection/blob/master/src/Namotion.Reflection/Context/ContextualType.cs#L146
I don't fully understand your code but I'd like to suggest the following possible solution
var getEnumeratorMethod = Methods.SingleOrDefault(m => m.Name == "GetEnumerator" && m.Parameters.Length == 0);