IdeaBlade.EntityModel Assembly > IdeaBlade.EntityModel Namespace > EntityManager Class : SaveChanges Method |
'Declaration
Public Sub SaveChanges( _ Optional ByVal saveOptions As SaveOptions _ )
'Usage
Dim instance As EntityManager Dim saveOptions As SaveOptions instance.SaveChanges(saveOptions)
public void SaveChanges( SaveOptions saveOptions )
Exception | Description |
---|---|
EntityManagerSaveException | Thrown for save exceptions not handled by an EntityServerError handler |
If the save fails an EntityManagerSaveException will be thrown.
If the save is cancelled the operation is a no-op, and the cache remains in the same state as before the save was called.
private void SaveSample() { DomainModelEntityManager mgr = new DomainModelEntityManager(); // Retrieve a single Order and its Customer OrderSummary order = mgr.ExecuteQuery<OrderSummary>(new entityKey(typeof(OrderSummary), 1)); Customer cust = order.Customer; // Change the address in both Order and Customer order.ShipAddress = "100 Broadway"; cust.Address = "100 Broadway"; // Now save try { mgr.SaveChanges(); } catch (EntityManagerSaveException ex) { MessageBox.Show(ex.Message); } }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2