I know how to serialize in F# using mutable objects, but is there a way to serialize/deserialize using record types using either XmlSerializer or the DataContractSerializer? loo
Beginning with F# 3.0, serialization of record types is now supported by applying the CliMutableAttribute
to the type. Example:
[]
type MyRecord = { Name : string; Age : int }
This example is taken from http://blogs.msdn.com/b/fsharpteam/archive/2012/07/19/more-about-fsharp-3.0-language-features.aspx, which includes a discussion of this feature and three other new features in F# 3.0: triple-quoted strings, automatic properties, and unused variable warnings.