Open GoogleCodeExporter opened 9 years ago
I haven't tried this, but you could try:
[DataMember(Order = 5)]
public long DateUnix
{
get
{
return DateCalc.ToUnixTime(this.Date);
}
private set;
}
But in general you're going to need a setter in order for serialization to have
something to set when deserializing.
Original comment by xeri...@gmail.com
on 3 Jun 2013 at 10:32
As xeridon nodes, it needs some mechanism to try to set the value during
deserialization. Since you clearly want `DateUnix` to *work*, it doesn't want
to disappoint you. You can usually get away with something like:
private set {
this.Date = DateCalc.FromUnixTime(value);
}
or, if you want to simply discard the result you could have an empty setter -
not sure that would be useful, though:
private set {}
Original comment by marc.gravell
on 4 Jun 2013 at 6:54
Original issue reported on code.google.com by
lukemaul...@gmail.com
on 29 May 2013 at 1:30