I suggest you ...

Date type for dates

System.DateTime maps to datetime2(7) in sql server wich is not optimal for storing date-only (without time) information.

SQL'92 has special Date type, for storing date-only.

It could be implemented by adding [DateOnly] or [DateWithoutTime] attribute for fields.

12 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    kl.vlad shared this idea  ·   ·  Admin →

    1 comment

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...
      • Brian Womack commented  · 

        What I really want is to be able to specify SQL data types that have the resolution I need. For most things, smalldatetime is sufficient, and takes a lot less space. For most things, regular datetime is fine. I rarely need the resolution of datetime2. I think we should have an attribute that lets us set the datetime type. I'd also like to see a good solution for TimeSpan.

      Feedback and Knowledge Base