EfCodeFirstBusinessBase<TEntity,TContext>.Save

Saves all changes.

public virtual bool Save(TEntity entity,
	bool useTransactionScope)

Parameters

entity

useTransactionScope
Optional - if true uses a transaction scope to wrap the save operation including the OnBeforeSave() and OnAfterSave() operations so they all run within the context of a single transaction that can be rolled back.
Use this if you have code in OnBeforeSave()/OnAfterChange() that might depend on a transaction or if you require that the Save() operation occurs under a specific Isolation Level (specified by overriding the GetTransactionScope() method).

Remarks

This method calls Context.SaveChanges() so it saves all changes made in the context not just changes made to the current entity. It's crucial to Save() as atomically as possible or else use separate Business object instances with separate contexts.


See also:

Class EfCodeFirstBusinessBase

© West Wind Technologies, 1996-2016 • Updated: 12/12/15
Comment or report problem with topic