From 160ec4042539e69a7494bcde5c893c6dffcbf1b6 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 19 Feb 2018 19:09:12 +0200 Subject: Working on developer module.. --- .../Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs index a05df573c..62f768b9d 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs @@ -158,7 +158,7 @@ namespace Tango.MachineStudio.DB.ViewModels { try { - await SelectedEntity.DeleteAsync(); + await SelectedEntity.DeleteAsync(Adapter.Context); } catch (Exception ex) { @@ -220,18 +220,18 @@ namespace Tango.MachineStudio.DB.ViewModels { if (mode == DialogOpenMode.Adding) { - entity.Attach(); + entity.Attach(Adapter.Context); } try { - await entity.SaveAsync(); + await entity.SaveAsync(Adapter.Context); } catch (DbUpdateException ex) { if (mode == DialogOpenMode.Adding) { - entity.Detach(); + entity.Detach(Adapter.Context); } Adapter.Invalidate(); _notification.ShowError("Could not save entity." + Environment.NewLine + ex.InnerException.InnerException != null ? ex.InnerException.InnerException.Message : ex.InnerException.Message); -- cgit v1.3.1