Click here to Skip to main content

.NET Framework

 
AnswerRe: winRT xaml/C# listview selected index [solved] PinmemberClodetta del Mar19-Feb-13 0:09 
QuestionReplacing Compiled Code for Scheduled Tasks Pinmemberindian14313-Feb-13 11:57 
AnswerRe: Replacing Compiled Code for Scheduled Tasks PinmemberJibesh13-Feb-13 12:07 
AnswerRe: Replacing Compiled Code for Scheduled Tasks PinmvpDave Kreskowiak13-Feb-13 17:50 
QuestionEntity Framework mapping issue Pinmemberalex.barylski13-Feb-13 7:32 
AnswerRe: Entity Framework mapping issue PinmemberRichard Deeming13-Feb-13 9:23 
GeneralRe: Entity Framework mapping issue Pinmemberalex.barylski13-Feb-13 9:45 
GeneralRe: Entity Framework mapping issue PinmemberRichard Deeming13-Feb-13 10:05 
Ah, OK - "timestamp" in SQL is something totally different.
 
I don't think there's any built-in way to perform this sort of conversion in the mapping layer. The simplest approach is probably to add a calculated property for the date, decorated with the NotMapped attribute:
Public Class WorkOrderEntity
   Private Shared ReadOnly Epoch As New DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero)
 
   <Column("DateReceived")> _
   Public Property DateReceivedTimestamp() As Integer
 
   <NotMapped> _
   Public Property DateReceived() As DateTimeOffset
      Get
         Return Epoch.AddSeconds(DateReceivedTimestamp)
      End Get
      Set
         DateReceivedTimestamp = CInt(Math.Floor((value - Epoch).TotalSeconds))
      End Set
   End Property
End Class
I'd be inclined to use DateTimeOffset for the property rather than a string; formatting the date should be a UI concern.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: Entity Framework mapping issue PinmvpDave Kreskowiak13-Feb-13 17:55 
QuestionProblem with my Kinect Runtime in running mode :( PinmemberYanni de Wouters9-Feb-13 12:59 
AnswerRe: Problem with my Kinect Runtime in running mode :( PinmvpRichard MacCutchan9-Feb-13 22:33 
GeneralRe: Problem with my Kinect Runtime in running mode :( PinmemberYanni de Wouters10-Feb-13 11:19 
GeneralRe: Problem with my Kinect Runtime in running mode :( PinmvpRichard MacCutchan10-Feb-13 22:39 
GeneralRe: Problem with my Kinect Runtime in running mode :( PinmemberYanni de Wouters7-Apr-13 6:32 
QuestionMemory managment Pinmemberimgags8-Feb-13 3:27 
AnswerRe: Memory managment PinmvpDave Kreskowiak8-Feb-13 3:47 
AnswerRe: Memory managment PinmvpEddy Vluggen9-Feb-13 1:21 
AnswerRe: Memory managment PingroupStyleTech Solutions Ltd9-Feb-13 4:02 
QuestionWhy dont call event PinmemberJunoli7-Feb-13 1:55 
AnswerRe: Why dont call event PinmvpEddy Vluggen7-Feb-13 10:00 
QuestionChange Collpased Text Color Settings in VB.Net PinmemberAmbiguousName7-Feb-13 0:46 
AnswerRe: Change Collpased Text Color Settings in VB.Net PinmvpRichard MacCutchan7-Feb-13 1:52 
GeneralRe: Change Collpased Text Color Settings in VB.Net PinmemberAmbiguousName7-Feb-13 2:12 
GeneralRe: Change Collpased Text Color Settings in VB.Net PinmvpRichard MacCutchan7-Feb-13 2:35 
GeneralRe: Change Collpased Text Color Settings in VB.Net PinmvpDave Kreskowiak7-Feb-13 3:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.150123.1 | Last Updated 26 Jan 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid