Flushes pending changes to the database.

Namespace:  Mindscape.LightSpeed
Assembly:  Mindscape.LightSpeed (in Mindscape.LightSpeed.dll)
Version: 4.0.0.0 (4.0.0.0)

Syntax

C#
void SaveChanges(
	bool reset
)
Visual Basic (Declaration)
Sub SaveChanges ( _
	reset As Boolean _
)

Parameters

reset
Type: System..::.Boolean
if set to true then clears all existing entities from the IUnitOfWork so that they will be reloaded on subsequent queries.

Examples

CopyC#
// Prepare changes to the database in the unit of work
var customer = unitOfWork.FindOne<Customer>(Entity.Attribute("Name") == "Arthur Wellesley");
customer.Name = "The Duke of Wellington";
unitOfWork.Add(new Customer { Name = "Gertrude Perkins" });
unitOfWork.Add(new Dogsbody { Name = "S Baldrick" });
unitOfWork.Remove(unitOfWork.FindOne<Customer>(Entity.Attribute("Name") == "Lord Smedley");
// Save the changes to the database
unitOfWork.SaveChanges(false);

See Also