Closed shiftkey closed 10 years ago
Have you looked at https://github.com/facebook-csharp-sdk/simple-json/pull/47
Recursion was one of my first thought and to later move it to iteration. But I did find GetRuntimeProperties that does the same.
Also in the meantime can u send a pr to reflection-utils.
@prabirshrestha If I've got no good reason to use GetRuntimeProperties
I'll push a PR to reflection-utils in the morning
Oh, and would you prefer this PR or what's currently in #47?
@shiftkey @haacked this fix should be available in v0.36.0 now. I already updated the reflection-utils project too to include this fix.
Never got a reply on this tweet, so will stick to the recursive solution. https://twitter.com/PrabirShrestha/status/439190680213409792
Hmm, too bad David didn't answer on Twitter. Maybe we can mention him here. Hey @davkean, any thoughts? The other person to try on Twitter is @terrajobst
The best person to talk to is @nguerrera. He's da reflection man.
Sorry for the delay. type.GetRuntimeProperties()
is the equivalent of calling
type.GetProperties(BindingFlags.Instance |
BindingFlags.Static |
BindingFlags.Public |
BindingFlags.NonPublic)
in the old world.
Does this answer your question?
@terrajobst
@prabirshrestha leave those PRs with me
public static IEnumerable<PropertyInfo> GetProperties(Type type)
{
#if SIMPLE_JSON_TYPEINFO
return type.GetRuntimeProperties();
#else
return type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
#endif
}
@terrajobst seems exactly what we need. Thanks.
@shiftkey also would need to do the same for GetFields()
@prabirshrestha done, review away!
@Haacked @shiftkey v0.38.0 is now available on nuget which makes use of GetRuntimeProperties()
Tried to update Octokit.net from 0.30 to 0.34 and found this regression.
Here's the simplest fix that gets me back to a happy place...