首页 新闻 会员 周边

dapper.simplecrud 批量删除mysql数据生成的sql 报错,有知道原因的吗?

0
悬赏园豆:5 [已解决问题] 解决于 2022-06-20 09:01

删除的方法如下:
await _connection.DeleteListAsync<EFCore.Entity.Demo>(" where id in(@ids)", new {ids =new string[]{"1","2"}});

生成的sql 语句类似:delete from demo where id in('1','2')
mysql 5.7
直接执行上述sql 也报错,有知道原因的吗

狼性法则的主页 狼性法则 | 初学一级 | 园豆:56
提问于:2022-04-20 09:31
< >
分享
最佳答案
0

方言问题,默认是sql server

狼性法则 | 初学一级 |园豆:56 | 2022-04-21 09:02
其他回答(1)
0

报错:对象名 'demo' 无效?

收获园豆:5
三人乐乐 | 园豆:4819 (老鸟四级) | 2022-04-20 11:05

不是,类似: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 '[u_info] where id in(('49f44bc3-01f7-4081-aa5c-64b28035ef3e'))' at line 1
再查询编辑器里面直接执行:delete from u_info where id in(('49f44bc3-01f7-4081-aa5c-64b28035ef3e')) ,也不行

支持(0) 反对(0) 狼性法则 | 园豆:56 (初学一级) | 2022-04-21 08:41
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册