My problem is that with the option type, referenced from C# side for some fields of the record, which have minOccur = 0, when i pass an option different from None, like FSharpOption.Some(0.00m) i get runtyme type error exceptions from within the serializer.
providing FSharp.Option.Some(T value) to the RecordType constructor should give no errors to,
and i should be able to get a valid System.Xml.Linq.XElement instance as output.
When i try to build the recordType instance with at least one optional value set to FSHarpOption.Some(value)
Here's the exception i get.
08:19:49,397 [12] Service - System.Exception: Unexpected value: Some(0.00)
at Microsoft.FSharp.Core.Operators.FailWith[T](String message)
at Microsoft.FSharp.Core.PrintfImpl.go@523-3[b,c,d](String fmt, Int32 len, FSharpFunc`2 outputChar, FSharpFunc`2 outa, b os, FSharpFunc`2 finalize,
FSharpList`1 args, Int32 i)
at Microsoft.FSharp.Core.PrintfImpl.run@521[b,c,d](FSharpFunc`2 initialize, String fmt, Int32 len, FSharpList`1 args)
at Microsoft.FSharp.Core.PrintfImpl.capture@540[b,c,d](FSharpFunc`2 initialize, String fmt, Int32 len, FSharpList`1 args, Type ty, Int32 i)
at <StartupCode$FSharp-Core>[email protected](T1 inp)
at <StartupCode$FSharp-Data>.$XmlRuntime.serialize$cont@209(CultureInfo cultureInfo, Object v, Unit unitVar) in C:\Git\FSharp.Data\src\Xml\XmlRunti
me.fs:line 219
Still have not found a workaround, i'll try to convert options to nullables form fsharp side, yet it's not very comfortable to accomplish in a fast manner.