aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/DataStore/Tango.DataStore.EF
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-12-03 03:48:25 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-12-03 03:48:25 +0200
commit3f2397750a3f5bbdf5ef78049c237ebeaff78319 (patch)
tree3a8b325c1f04fa90c114893d84c65020fce7920d /Software/Visual_Studio/DataStore/Tango.DataStore.EF
parentc873eb1c0324eb50428fc26cdb5f1c3d05c7d3ea (diff)
downloadTango-3f2397750a3f5bbdf5ef78049c237ebeaff78319.tar.gz
Tango-3f2397750a3f5bbdf5ef78049c237ebeaff78319.zip
DataStore fixes.
Diffstat (limited to 'Software/Visual_Studio/DataStore/Tango.DataStore.EF')
-rw-r--r--Software/Visual_Studio/DataStore/Tango.DataStore.EF/EFDataStoreCollection.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.EF/EFDataStoreCollection.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.EF/EFDataStoreCollection.cs
index c1b45e37f..6ccc6d78a 100644
--- a/Software/Visual_Studio/DataStore/Tango.DataStore.EF/EFDataStoreCollection.cs
+++ b/Software/Visual_Studio/DataStore/Tango.DataStore.EF/EFDataStoreCollection.cs
@@ -57,6 +57,7 @@ namespace Tango.DataStore.EF
item.Value = EFDataStoreHelper.CreateBytes(type, value);
item.IsSynchronized = false;
item.LastUpdated = DateTime.UtcNow;
+ item.IsDeleted = false;
db.SaveChanges();
}
@@ -91,7 +92,7 @@ namespace Tango.DataStore.EF
{
using (var db = ObservablesContext.CreateDefault())
{
- var item = db.DataStoreItems.SingleOrDefault(x => x.CollectionName == Name && x.Key == key);
+ var item = db.DataStoreItems.SingleOrDefault(x => x.CollectionName == Name && x.Key == key && !x.IsDeleted);
if (item == null)
{
@@ -123,7 +124,7 @@ namespace Tango.DataStore.EF
{
using (var db = ObservablesContext.CreateDefault())
{
- var localItems = db.DataStoreItems.Where(x => x.CollectionName == Name).ToList();
+ var localItems = db.DataStoreItems.Where(x => x.CollectionName == Name && !x.IsDeleted).ToList();
var globalItems = db.GlobalDataStoreItems.Where(x => x.CollectionName == Name).ToList();
foreach (var globalItem in globalItems.ToList())