Hi,
I have looked around the Googular response
(only really seen one: f# - Object initialization syntax - Stack Overflow ; )
and hit my head against a wall on this a couple of different times, but now it bugs me enough that i seek assistance (perhaps that i may hit my head smarter, not harder?).
C# lets you do this with Object Initializer syntax.
// Deserialize using altername names.
var inputOptions = new JsonSerializerOptions
{
TypeInfoResolver = new DefaultJsonTypeInfoResolver
{
Modifiers = { JsonExtensions.UseAternameNames<Json3rdPartyAlternativeNameAttribute>() },
},
};
Writing the F# equivalent following the above stackoverflow link has worked for me in the past with certain Properties, passing them as named arguments in F# (so long as they allow setting!)
But the documentation for Modifiers property calls it a ‘get’ only. Not even ‘init’.
So how does C# even let you do this?
Further (and more importantly for my case : ),
how can i set this Property in F# (when i try, i get the above error from the subject).
Thank you,
-Gerald