1、数据库迁移报错:Table 'testdbcore.__efmigrationshistory' doesn't exist
解决办法是先生成迁移表:__EFMigrationsHistory
生成表语句:
CREATE TABLE `__EFMigrationsHistory` (
`MigrationId` nvarchar (150) NOT NULL,
`ProductVersion` nvarchar (32) NOT NULL,
PRIMARY KEY (`MigrationId`)
);
2、不能直接使用.Any()判断是否为空,报错内容是:No coercion operator is defined between types 'System.Int16' and 'System.Boolean'.
解决办法:判断改为(context.RMS_User!=null && context.RMS_User.Count()>0)
网上说这个异常是MySql的一个bug:httpss://bugs.mysql.com/bug.php?id=92987
;