Click here to Skip to main content
12,625,694 members (37,015 online)

.NET Framework

 
AnswerRe: winRT xaml/C# listview selected index [solved] Pin
Clodetta del Mar19-Feb-13 0:09
memberClodetta del Mar19-Feb-13 0:09 
QuestionReplacing Compiled Code for Scheduled Tasks Pin
indian14313-Feb-13 11:57
memberindian14313-Feb-13 11:57 
AnswerRe: Replacing Compiled Code for Scheduled Tasks Pin
Jibesh13-Feb-13 12:07
memberJibesh13-Feb-13 12:07 
AnswerRe: Replacing Compiled Code for Scheduled Tasks Pin
Dave Kreskowiak13-Feb-13 17:50
mvpDave Kreskowiak13-Feb-13 17:50 
QuestionEntity Framework mapping issue Pin
alex.barylski13-Feb-13 7:32
memberalex.barylski13-Feb-13 7:32 
AnswerRe: Entity Framework mapping issue Pin
Richard Deeming13-Feb-13 9:23
memberRichard Deeming13-Feb-13 9:23 
GeneralRe: Entity Framework mapping issue Pin
alex.barylski13-Feb-13 9:45
memberalex.barylski13-Feb-13 9:45 
GeneralRe: Entity Framework mapping issue Pin
Richard Deeming13-Feb-13 10:05
memberRichard 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 Pin
Dave Kreskowiak13-Feb-13 17:55
mvpDave Kreskowiak13-Feb-13 17:55 
QuestionProblem with my Kinect Runtime in running mode :( Pin
Yanni de Wouters9-Feb-13 12:59
memberYanni de Wouters9-Feb-13 12:59 
AnswerRe: Problem with my Kinect Runtime in running mode :( Pin
Richard MacCutchan9-Feb-13 22:33
mvpRichard MacCutchan9-Feb-13 22:33 
GeneralRe: Problem with my Kinect Runtime in running mode :( Pin
Yanni de Wouters10-Feb-13 11:19
memberYanni de Wouters10-Feb-13 11:19 
GeneralRe: Problem with my Kinect Runtime in running mode :( Pin
Richard MacCutchan10-Feb-13 22:39
mvpRichard MacCutchan10-Feb-13 22:39 
GeneralRe: Problem with my Kinect Runtime in running mode :( Pin
Yanni de Wouters7-Apr-13 6:32
memberYanni de Wouters7-Apr-13 6:32 
QuestionMemory managment Pin
imgags8-Feb-13 3:27
memberimgags8-Feb-13 3:27 
AnswerRe: Memory managment Pin
Dave Kreskowiak8-Feb-13 3:47
mvpDave Kreskowiak8-Feb-13 3:47 
AnswerRe: Memory managment Pin
Eddy Vluggen9-Feb-13 1:21
mvpEddy Vluggen9-Feb-13 1:21 
AnswerRe: Memory managment Pin
StyleTech Solutions Ltd9-Feb-13 4:02
groupStyleTech Solutions Ltd9-Feb-13 4:02 
QuestionWhy dont call event Pin
Junoli7-Feb-13 1:55
memberJunoli7-Feb-13 1:55 
AnswerRe: Why dont call event Pin
Eddy Vluggen7-Feb-13 10:00
mvpEddy Vluggen7-Feb-13 10:00 
QuestionChange Collpased Text Color Settings in VB.Net Pin
AmbiguousName7-Feb-13 0:46
memberAmbiguousName7-Feb-13 0:46 
AnswerRe: Change Collpased Text Color Settings in VB.Net Pin
Richard MacCutchan7-Feb-13 1:52
mvpRichard MacCutchan7-Feb-13 1:52 
GeneralRe: Change Collpased Text Color Settings in VB.Net Pin
AmbiguousName7-Feb-13 2:12
memberAmbiguousName7-Feb-13 2:12 
GeneralRe: Change Collpased Text Color Settings in VB.Net Pin
Richard MacCutchan7-Feb-13 2:35
mvpRichard MacCutchan7-Feb-13 2:35 
GeneralRe: Change Collpased Text Color Settings in VB.Net Pin
Dave Kreskowiak7-Feb-13 3:12
mvpDave Kreskowiak7-Feb-13 3:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    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
Web02 | 2.8.161205.3 | Last Updated 30 Nov 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid