【问题标题】:EF migration can't Alter(change) Datetime(DataType) column to long(bigint)EF 迁移不能将 Datetime(DataType) 列更改为 long(bigint)
【发布时间】:2020-07-30 11:50:18
【问题描述】:

我使用 EF 代码优先方法并通过 包管理器控制台

更改数据库

尝试将列 invoiceno 日期时间更改为长

添加迁移“消息”

Update-Database 命令返回错误

Implicit conversion from data type datetime to bigint is not allowed. Use the CONVERT function to 
run this query.

【问题讨论】:

    标签: entity-framework ef-code-first alter-column


    【解决方案1】:

    在前面插入

        [DatabaseGenerated(DatabaseGeneratedOption.None)]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-07-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-01
      • 2011-07-08
      • 2012-01-20
      • 2017-12-21
      相关资源
      最近更新 更多