I have a table in my database where I save my user's profile data as Key-Value pair. This pair is always string-string. Example:
| Id | Name | Value | UserId |
|:--:|:---------:|:-------:|:------:|
| 1 | FirstName | Some | 55 |
| 2 | LastName | One | 55 |
| 3 | Birthdate | ? | 55 |
| 4 | FirstName | Another | 88 |
I am a bit concerned about saving DataTime
data as string. Is saving the DataTime.Ticks.ToString()
(and then reconverting it again to DateTime
when needed to be used) safe and a good idea? or is there any better approach?