diff options
| -rw-r--r-- | Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk | bin | 1532 -> 1516 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/Tango.BL/ObservablesContextConfiguration.cs | 21 |
2 files changed, 20 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk b/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk Binary files differindex 21b63193d..cd233d031 100644 --- a/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk +++ b/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk diff --git a/Software/Visual_Studio/Tango.BL/ObservablesContextConfiguration.cs b/Software/Visual_Studio/Tango.BL/ObservablesContextConfiguration.cs index 90d78f6bc..07c3f5306 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesContextConfiguration.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesContextConfiguration.cs @@ -5,6 +5,7 @@ using System.Data.Entity.Infrastructure; using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Tango.Core.Helpers; @@ -22,7 +23,25 @@ namespace Tango.BL public ObservablesContextConfiguration() : base() { Directory.CreateDirectory(FolderPath); - SetModelStore(new DefaultDbModelStore(FolderPath)); + var modelStore = new DefaultDbModelStore(FolderPath); + + try + { + modelStore.TryLoad(typeof(ObservablesContext)); + } + catch + { + try + { + Directory.Delete(FolderPath, true); + Thread.Sleep(1000); + Directory.CreateDirectory(FolderPath); + } + catch { } + modelStore = new DefaultDbModelStore(FolderPath); + } + + SetModelStore(modelStore); } public static void ClearModelStore() |
