Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Affected Rows Entity Framework

Tags:

ado.net

How do I get the number of rows affected after a SaveChanges()?

like image 808
OneSmartGuy Avatar asked Jun 15 '09 15:06

OneSmartGuy


1 Answers

The SaveChanges Method returns an int of all items changed.

MSDN Snippet:

Return Value

Type: System.Int32

The number of objects in an Added, Modified, or Deleted state when SaveChanges was called.

like image 159
bendewey Avatar answered Nov 07 '22 13:11

bendewey