Can I use a single DateTime field on the Entity Framework model side when the value is stored in a set of Int fields in the actual database?

Posted by Ivan on Stack Overflow See other posts from Stack Overflow or by Ivan
Published on 2012-11-19T22:48:39Z Indexed on 2012/11/19 23:00 UTC
Read the original article Hit count: 286

Filed under:
|
|

The actual table in the database has separate integer fields for storing year, month, day, hour and minute values (all in UTC) (seconds and milliseconds are irrelevant for my task and considered equal to zero).

Needless to say it would be of great convenience to have just one field of DateTime type on the application side and hide all the conversion under the cover of the Entity Framework model code.

Any directions on how to do that? I am not very experienced with Entity Framework yet.

© Stack Overflow or respective owner

Related posts about .NET

Related posts about entity-framework