This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FSharpOptionConverter : JsonConverter | |
{ | |
private static MethodInfo _getInnerValue = typeof (FSharpOptionConverter).GetMethod("GetInnerValue", | |
BindingFlags.Instance | | |
BindingFlags.NonPublic); | |
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) | |
{ | |
if (value != null) | |
{ | |
var optionValueType = value.GetType().GetGenericArguments().Single(); |