积极答复者
EF中的SaveChenges()方法返回值问题

问题
答案
-
SaveChanges方法的返回值问题,一直不明白,在这里想问问大家,具体是怎么回事儿,在增删改查都返回什么值
对于增加,返回的是增加成功的行数。
对于更新,返回的时候成功更新了几行。
对于删除,返回到底成功删除了几行。
ASP.NET Forum
Other Discussion Forums
FreeRice Donate
Issues to report
Free Tech Books Search and Download- 已标记为答案 Fred BaoModerator 2015年8月24日 9:25
-
你好,
根据MSDN官方的文档,https://msdn.microsoft.com/zh-cn/library/system.data.entity.dbcontext.savechanges(v=vs.113).aspx
Return Value Type: System.Int32 The number of objects written to the underlying database.
返回值应该是返回数据库中受影响记录的行数。
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- 已标记为答案 Fred BaoModerator 2015年8月24日 9:25
全部回复
-
你好,
根据MSDN官方的文档,https://msdn.microsoft.com/zh-cn/library/system.data.entity.dbcontext.savechanges(v=vs.113).aspx
Return Value Type: System.Int32 The number of objects written to the underlying database.
返回值应该是返回数据库中受影响记录的行数。
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- 已标记为答案 Fred BaoModerator 2015年8月24日 9:25
-
SaveChanges方法的返回值问题,一直不明白,在这里想问问大家,具体是怎么回事儿,在增删改查都返回什么值
对于增加,返回的是增加成功的行数。
对于更新,返回的时候成功更新了几行。
对于删除,返回到底成功删除了几行。
ASP.NET Forum
Other Discussion Forums
FreeRice Donate
Issues to report
Free Tech Books Search and Download- 已标记为答案 Fred BaoModerator 2015年8月24日 9:25