为什么Dapper的.Execute(...)返回一个int? [英] Why does Dapper's .Execute(...) return an int?

查看:270
本文介绍了为什么Dapper的.Execute(...)返回一个int?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都知道Dapper为什么从 .Execute(...)返回int吗?

Anyone know why Dapper returns an int from .Execute(...) ?

我在任何地方都找不到此文档。

I can't find this documented anywhere.

推荐答案

整数表示受查询影响的行数。

The integer represents the number of rows that were affected by your query.

它返回一个整数,因此您知道查询是否有效。如果返回零,并且您希望某些更改,则说明存在问题。

It returns an integer so you know if your query has worked. If zero is returned and you expected something to have changed then you know there is a problem.

这篇关于为什么Dapper的.Execute(...)返回一个int?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆