Error While Enabling Code-First Migrations On Mobile Services Database

前端 未结 5 1697
你的背包
你的背包 2021-02-07 17:12

I have an Azure Mobile Services project (C# backend) that I recently created and attached to an Azure SQL database. I have been trying to enable Code-First Migrations on that ba

5条回答
  •  鱼传尺愫
    2021-02-07 17:50

    Several of the answers about deriving from a custom entity class will work, but they are not the ideal solution. As the EF team (and others) have mentioned, you need to simply add this line to your Context Configuration constructor.

     SetSqlGenerator("System.Data.SqlClient", new EntityTableSqlGenerator());
    

    This will remove your errors when creating migrations and allow you to update the database via powershell command.

提交回复
热议问题