About 50,200 results
Open links in new tab
  1. How entity framework SaveChanges works? - Stack Overflow

    May 1, 2018 · When SaveChanges () is executed to insert, update or delete on the database then Entity framework will wrap that operation in a transaction. This transaction lasts only long enough to …

  2. c# - Entity Framework SaveChanges () vs ... - Stack Overflow

    May 5, 2015 · Entity Framework SaveChanges () vs. SaveChangesAsync () and Find () vs. FindAsync () Asked 10 years, 7 months ago Modified 6 months ago Viewed 138k times

  3. c# - Is that possible, DbContext.SaveChanges () returns 0 but doesn't ...

    Mar 20, 2017 · Is that possible, DbContext.SaveChanges () returns 0 but doesn't have an exception? Asked 13 years, 6 months ago Modified 5 years, 2 months ago Viewed 64k times

  4. When should I call SaveChanges() when creating 1000's of Entity ...

    I've actually found that the performance degrades between each call to SaveChanges (). The solution to this is to actually dispose the context after each SaveChanges () call, and re-instantiate a new one …

  5. How does DbContext.SaveChanges() work in C# when updating a table?

    Oct 16, 2020 · When SaveChanges call, it ask the ef to know which entity state has been changed and try to update database. But I recommend that set AsNoTracking when get an entity from database …

  6. EF: db.SaveChanges() vs dbTransaction.Commit - Stack Overflow

    Jun 14, 2018 · An explicit transaction is useful when wishing/needing to have multiple 'SaveChanges' inside a single DB transaction, possibly interleaved with non-EF DB access.

  7. savechanges - Check if an insert or update was successful in Entity ...

    Feb 8, 2017 · But if question asks : Please tell, when multiple entities (or single entity) are added or updated to context and context.SaveChanges() method is called, how to check if actual INSERT or …

  8. c# - When to call SaveChanges - Stack Overflow

    All operations will be executed within a single transaction (for a single saveChanges call) which means that either all or none will be propogated to the database at once. Before calling save changes, the …

  9. Multiple SaveChanges calls in entity framework - Stack Overflow

    Apr 26, 2014 · 10 It is a bad practice to call SaveChanges multiple times (Without a transaction scope) when the related entities should be persisted in a single transaction. What you have created is a …

  10. SaveChanges vs SaveChangesAsync in Entity Framework

    Dec 2, 2016 · Can explain somebody what is the main differences between SaveChanges and SaveChangesAsync ? Where I should use SaveChangesAsync and when ? How's the performance …