Skip to content

Instantly share code, notes, and snippets.

View HectorMongoose's full-sized avatar

HectorMongoose

View GitHub Profile
@HectorMongoose
HectorMongoose / TryInvokeMember.cs
Last active August 29, 2015 14:01
JObject.JObjectDynamicProxy.TryInvokeMember
// Not sure if you'll like this at all, but adding this method to JObject.JObjectDynamicProxy
// allows us to use the invoked method as the default parameter, if the value does not exist.
// For example:
dynamic parsedObject = new JObject();
d.test = "Non-default option";
Console.WriteLine("Test is: " + d.test("Default Option"));
// Outputs:

Keybase proof

I hereby claim:

  • I am HectorMongoose on github.
  • I am hectormongoose (https://keybase.io/hectormongoose) on keybase.
  • I have a public key whose fingerprint is EE8F 8982 C0DD 94B4 5540 CC45 3B96 2F76 F9F9 969F

To claim this, I am signing this object: