您当前的位置:首页 > .Net家族

.Net Core使用MySQL

作者:无涯 时间:2019-04-23 17:20:07 阅读数:844 人阅读

1、数据库迁移报错:Table 'testdbcore.__efmigrationshistory' doesn't exist

undefined

解决办法是先生成迁移表:__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'.

undefined

undefined

解决办法:判断改为(context.RMS_User!=null && context.RMS_User.Count()>0)

网上说这个异常是MySql的一个bug:httpss://bugs.mysql.com/bug.php?id=92987

;

本站所有文章、数据、图片均来自互联网,一切版权均归源网站或源作者所有。

如果侵犯了你的权益请来信告知我们删除。邮箱:2780053831@qq.com

标签: .net core mysql
四川旅游网为您推荐-飞猪旅游

猜你喜欢