dotnetcore / FreeSql

🦄 .NET aot orm, C# orm, VB.NET orm, Mysql orm, Postgresql orm, SqlServer orm, Oracle orm, Sqlite orm, Firebird orm, 达梦 orm, 人大金仓 orm, 神通 orm, 翰高 orm, 南大通用 orm, 虚谷 orm, 国产 orm, Clickhouse orm, QuestDB orm, MsAccess orm.
http://freesql.net
MIT License
3.99k stars 842 forks source link

达梦8数据库,Insert新增方法bug #1759

Open zgmqdl opened 1 month ago

zgmqdl commented 1 month ago

问题描述及重现代码:

var rows = await _freeSql.Insert<Model>(entity).ExecuteInsertedAsync();

这个方法的返回值里面没有返回插入的实体Id

数据库版本

DM8

安装的Nuget包

.net framework/. net core? 及具体版本

.Net core7

zgmqdl commented 1 month ago

mysql也有这个问题

2881099 commented 1 month ago

看同步方法的注释

ExecuteInsered

zgmqdl commented 1 month ago

好的,看到了。“注意:此方法只有 Postgresql/SqlServer 有效果” 那达梦或者mysql有没有替代的方法

2881099 commented 1 month ago

没有,mariadb 可以,mysql 不行。

luoyunchong commented 1 month ago

可以使用仓储的方法,会回填id

https://freesql.net/guide/repository.html