Serializacja zmiennej F # mutable na JSON za pomocą Json.NET generuje zduplikowane elementy
Oto mój kod:
open Newtonsoft.Json
open Newtonsoft.Json.Converters
type T = {
mutable name : string;
mutable height : int;
}
let a = { name = "abc"; height = 180;}
a.height <- 200
let b = JsonConvert.SerializeObject(a, Formatting.Indented)
printfn "%s" b
Wynikiem kodu jest:
{
"name@": "abc",
"height@": 200,
"name": "abc",
"height": 200
}
Jak mogę uniknąć wyjść z „@” w poprawności?