CreatedOn column in Entity Framework 6

前端 未结 2 754
别跟我提以往
别跟我提以往 2020-12-18 18:29

After upgrading to Entity Framework 6 we\'ve implemented our own DbExecutionStrategy. In addition to existing SqlAzureExecutionStrategy our strategy also l

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-18 18:45

    In a past Entity Framework used to have a column "CreatenOn" in __MigrationHistory table.

    Every time the AppDomain starts it checks if Migration is required the the database. EF actually tries to read "CreatedOn" columns and obviously fails with the exception which gets logged. EF has an ugly try/catch all block around this check and if the exception is thrown (column is missing) then it doesn't try to "migrate" CreatedOn column.

    There is no way at the moment to disable that check, except just not to log it...

提交回复
热议问题