I'm assuming the use of Newtonsoft JSON.Net and you may want to look at a JSONPath reference for those who understand XML's XPath queries and want to apply them to JSON.

This is a generic function that's good for any type with a default value. To use it, you would write…

int x = datajobject.JPathValue<int>("$.my.path[0].to..the_value");
float y = datajobject.JPathValue<float>("$.another..path");
string z = datajobject.JPathValue<string>("$..had..enough.*.yet");
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace ExtensionMethods {
    public static class JSONExtensions {
        public static T JPathValue<T>(this JObject jobj, string JPath) {
            JToken jtkn = jobj.SelectToken(JPath, false);
            return jtkn == null ? default(T) : jtkn.Value<T>();
        }
    }
}

Bear in mind this function is designed to return the value of only the first match to the JSONPath. If you're attempting to pull an array of values, you'll want to look at JToken.SelectTokens().