使用 属性 而不是 'Id' 作为 Dapper.net 中的主键

Using property other than 'Id' for primary key in Dapper.net

如果我使用 属性 而不是 "Id" 或 "id" 作为 table / 对象的主键,Dapper.net 会起作用吗?

我在文档中看到的只是一些关于 "split on" 的内容,我没有遵循。

是否可以在不知道主键是什么/没有 Id 的情况下映射插入、更新和选择 属性?

如果没有 Id 字段,其他任何事情都会有所不同或不起作用吗?

Will Dapper.net work if I am using a property other than "Id" or "id" for the primary key of a table / object?

只要没有问题,dapper 就不会对此有任何问题,dapper 作为一个对象映射器,不太关心主键

Except That

当您执行包含自定义类型的复杂对象映射时,使用 Id 它可以在 Query 调用中自动拆分并填充对象。这是因为他们需要一些标准来填充对象,可以通过提供 SplitOn

来覆盖这些对象