Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Overloaded GetEnumerator #113

Open
ryanwilliams83 opened this issue May 2, 2022 · 0 comments
Open

Support Overloaded GetEnumerator #113

ryanwilliams83 opened this issue May 2, 2022 · 0 comments

Comments

@ryanwilliams83
Copy link

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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant