Hi,
Thanks for the answer.
I disagree mainly because DateTime and TimeSpan (alongside
DateTimeOffset, Guid, Uri, and byte arrays). are special cases as they
are really primitive types (not on a compiler level, but on a
serialization level) and are special cases and should have custom
handling in a serializer.
Looking at it from the opposite perspective it is hard, in my view,
justify the following struct failing serialize->deserialize test.
struct Example {
public int Ticks {get;set;}
}
Anyway, these are just my opinions, thank you for your explanations.
Thanks
Tymek
> > Dnia 01/09/2011 o godz. 20:56 Demis Bellot <
demis.bel...@gmail.com>
> > napisał(a):
>
> > Nope, most ValueTypes are just convenience properties around a single
> > scalar value.
>
> > e.g. DateTime has 13 instance properties that are just convenience
> > properties over a 64bit value, so it's best to only serialize it's value not
> > all of it's properties.
>
> > Cheers,
>
> > On Thu, Sep 1, 2011 at 5:04 AM, Tymek < <
letssellsomebana...@gmail.com>
> >
letssellsomebana...@gmail.com> wrote:
>
> >> Hi,
>
> >> When a struct (not a class) is serialized using
> >> ServiceStack.ServiceModel.Serialization.JsonDataContractSerializer it
> >> is represented by what the struct's ToString() returns.
>
> >> Surely, this is wrong or I am missing something.
>
> >> Thanks in advance,
> >> Tymek
>
> > --
> > - Demis
>
> > <
http://twitter.com/demisbellot>
http://twitter.com/demisbellot
> > <
http://www.servicestack.net/mythz_blog>