Dear Support,
We have got a problem with objects with DateTime property:
Background infomation:
WCF communication from Server to CSHTML5 client direction:
if certain object has a DateTime property at the default constructor state the value is something like that from .NET point of view, e.g.:
ValidTimeStamp {0001. 01. 01. 0:00:00} System.DateTime
So, when you try to pass such a value to CSHTML5 client you got exception: Error "cannot construct UInt64 from negative number".
If you do:
ValidTimeStamp = new DateTime(1971, 1, 1); // problem: Kind Unspecified System.DateTimeKind
You will get the same exception.
If you do ValidTimeStamp = DateTime.Now;
No problem at all.
So, as we think the probleblem is coming from the Kind property of DateTime struct:
the first case you will got DateTimeKind = Unspecified, and you got error.
We had a workaround this, e.g.:
ValidTimeStamp = new DateTime(1971, 1, 1).ToUniversalTime();
or:
ValidTimeStamp = new DateTime(1971, 1, 1).ToLocalTime();
Just to avoid Unspecified DateTimeKind property.
Is this an expected behaviour or a kind of bug?
Thanks in advance,
Péter
ps: I hope this info helps to others to avoid from such a bug.