Tuesday, 27 August 2013

EF, How to save/retrieve TimeSpan as other data type?

EF, How to save/retrieve TimeSpan as other data type?

SQLCe doesn't support TimeSpan, so I need to save this in some other way.
Is it possible to define somewhere a default conversion, like in the
DbContext, or would I need to handle this manually in the repositories? I
don't like to change my entity classes just because of this.
Btw, I only save TimeSpan of < 24h.
Example would be great if there are some neat tricks.

No comments:

Post a Comment