I'm hoping that someone could explain how/why this does not work for determining a object's type dynamically then using the type in generics.
This will work because I'm specifying DateTime explicitly hardcoded as the type:
string serializedObject = JsonConvert.SerializeObject(exampleObject);
Type dataType = exampleObject.GetType();
JObject jObject = JObject.Parse(serializedObject);
jObject.Value<DateTime>("propertyName");
However neither of these seem to work:
jObject.Value<typeof(dateType)>("propertyName");
jObject.Value<dateType>("propertyName");
How can I specify the type of an property correctly here:
jObject.Value<{WHAT SHOULD I PUT HERE}>("propertyName");