Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 1.44 KB

FSharp.md

File metadata and controls

43 lines (31 loc) · 1.44 KB

F#

NuGet Status

F# support is shipped in a separate nuget Argon.FSharp.

Converters

  • FSharpListConverter
  • FSharpMapConverter
  • DiscriminatedUnionConverter

FSharpConverters.Instances

var json = JsonConvert.SerializeObject(
    target,
    Formatting.Indented,
    FSharpConverters.Instances);

var result = JsonConvert.DeserializeObject<Target>(
                 json,
                 FSharpConverters.Instances) ??
             throw new ArgumentNullException("JsonConvert.DeserializeObject<Target>(json, FSharpConverters.Instances)");

snippet source | anchor

Add F# Converters to a JsonSerializerSettings

var settings = new JsonSerializerSettings();
settings.AddFSharpConverters();

snippet source | anchor