if (JToken.op_Explicit(apiConfig["finjVersion"]) < JToken.op_Explicit(latestData["finjVersion"]))
{
...
}
Error: JToken.explicit operator bool(JToken)': cannot call operator or accessor directly
I tried searching it in Newtonsoft's website or Microsoft and found nothing.
It looks like you are trying to invoke one of the explicit conversion operators of
JTokento convert a JSON property value to a .NET primitive. In order to use these operators, you must use the explicit conversion syntax of c# to cast the value to the required primitive type. You must also choose an appropriate .NET primitive type to which to cast that corresponds to the JSON property value.E.g. if the value of
"finjVersion"is some integer such as"finjVersion" : 1you should do:Demo #1 here.
If the value of
"finjVersion"does not correspond to a .NET primitive, rather than casting you must useToObject<T>()to deserialize to the required type. E.g. if"finjVersion"looks like"finjVersion":"1.1.2.0", you could deserialize toSystem.Versionlike so:Demo #2 here.