our database has times stored utc, , know user's current timezone, want return relative that. want incorporate offset in linq projection so: var users = u in this.context.users select new userwithcorrecteddate { id = u.id, firstname = u.firstname, lastname = u.lastname, registrationdate = u.registrationdate.value.addhours(-5) }; of course, linq2ef cannot convert " addhours " canonical function. there way this? update: another thought, if timezone offset stored in database column, there way have db perform calculation (date + offset)? linq entities supports sqlfunctions. if know offset number of hours this: var users = u in this.context.users select new userwithcorrecteddate { id = u.id, firstname = u.firstname, lastname = u.lastname, registrationdate = sqlfunctions.dat...
Comments
Post a Comment