Hi,
Is there any way to get the rows affected as we have in ADO.Net after Insert, Update or Delete operations in Entity Framework?
If yes please tell how?
Yes. It is possible using the SaveChanges method of the Entity Framework. It returns an Integer value.
using (CustomersEntities entities = new CustomersEntities()) { entities.Customers.Add(customer); int insertedRecords = entities.SaveChanges(); }
© COPYRIGHT 2024 ASPSnippets.com ALL RIGHTS RESERVED.