3

Is there an equivalent of C#'s TimeSpan in the Bond type system? If not, how can I interoperate between TimeSpan and a field in a Bond struct?

chwarr
  • 6,777
  • 1
  • 30
  • 57
yuvalm2
  • 866
  • 2
  • 10
  • 27

1 Answers1

5

There is no builtin type for C#'s TimeSpan, but you can use custom type mapping to achieve the same result. See this official example for DateTime.

chwarr
  • 6,777
  • 1
  • 30
  • 57
vharavy
  • 4,881
  • 23
  • 30
  • 2
    I'd recommend using an `int64` field in the Bond struct to store the `TimeSpan.Ticks` value, which you'd then use in the converters. – chwarr Sep 14 '16 at 18:26