How do I map TimeSpan with greater than 24 hours to SQL server Code First?

后端 未结 3 698
自闭症患者
自闭症患者 2020-12-29 01:34

I am trying to map a TimeSpan Code First property to SQL server. Code First seems to be creating it as a Time(7) in SQL. However TimeSpan in .Net can handle longer periods t

3条回答
  •  粉色の甜心
    2020-12-29 02:26

    As far as I know there is no equivalent data type in SQL Server for .NET's TimeSpan. The closest match is Time, but, as you pointed out, it only supports values up to 24 hours? http://msdn.microsoft.com/en-us/library/ms186724.aspx#DateandTimeDataTypes.

    The following MSDN document describes this http://msdn.microsoft.com/en-us/library/bb386909.aspx. I'm assuming that since there is no solution listed there, it's not currently possible.

提交回复
热议问题