NET+MVC+EF数据库是mysql更新删除都报错

¥ 100

¥ 100 开源众包 Technology & Programming China
337 days ago

Description

我现在的的项目是 NET+MVC+EF,数据库是mysql,各版本如下
EF为6.13
.net framework 4.5.2
mysqlserver 5.7.18
项目本身编译运行没有问题,也可以进后台,后台界面各表的数据用EF语句 可以查询,添加数据都正常,但是修改和删除(代码都是对的,数据库如果是sqlerver中运行正常)都报类似的错误,You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[test].[test_rule] SET ... at line 1
这个如何解决? 更新语句都是标准写法如下
res = ef.test_rule.Where(a => a.TestID == model.TestID).AsNoTracking().Update(a => new test_rule
{
TestName = model.TestName,
ShortTestName=model.ShortTestName

});
删除: result = ef.test_rule.Where(a => a.TestID == yfID).AsNoTracking().Delete();

关注公众号,不定期副业成功案例分享
Follow WeChat

Success story sharing

Want to stay one step ahead of the latest teleworks?

Subscribe Now

Similar Teleworks

¥ 50000-100000 Technology & Programming 开源众包 China
19 hour ago