aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common/DataStore
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-10-23 03:58:38 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-10-23 03:58:38 +0300
commit2d803e9410cd383d8e66c300f86fe0f7374c81ea (patch)
tree7ac7ac109fd8cafd0752673e826123475b9f0e13 /Software/Visual_Studio/PPC/Tango.PPC.Common/DataStore
parent8d2b13aaa70bc6a8f521df4eab165caf078c33fa (diff)
downloadTango-2d803e9410cd383d8e66c300f86fe0f7374c81ea.tar.gz
Tango-2d803e9410cd383d8e66c300f86fe0f7374c81ea.zip
Improvements to DataStore Remote.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/DataStore')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/DataStore/DefaultDataStoreService.cs14
1 files changed, 12 insertions, 2 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/DataStore/DefaultDataStoreService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/DataStore/DefaultDataStoreService.cs
index e6da8e8e7..f11d37659 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/DataStore/DefaultDataStoreService.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/DataStore/DefaultDataStoreService.cs
@@ -15,6 +15,7 @@ using Tango.PMR.DataStore;
using Tango.PPC.Common.Connection;
using Tango.PPC.Common.ExternalBridge;
using Tango.Transport;
+using Tango.Core.ExtensionMethods;
namespace Tango.PPC.Common.DataStore
{
@@ -71,7 +72,7 @@ namespace Tango.PPC.Common.DataStore
var item = GetManager().GetCollection(request.Collection).GetItem(request.Key, request.DefaultValue);
await receiver.SendGenericResponse(new RemoteDataStoreGetItemResponse()
{
- Item = item
+ Item = CreateRemoteItem(item)
}, token);
}
@@ -105,7 +106,7 @@ namespace Tango.PPC.Common.DataStore
var all = GetManager().GetCollection(request.Collection).GetAll();
await receiver.SendGenericResponse(new RemoteDataStoreGetAllResponse()
{
- Items = all
+ Items = all.Select(x => CreateRemoteItem(x)).ToList()
}, token);
}
@@ -119,6 +120,15 @@ namespace Tango.PPC.Common.DataStore
}, token);
}
+ private RemoteDataStoreItem CreateRemoteItem(IDataStoreItem item)
+ {
+ RemoteDataStoreItem remote = new RemoteDataStoreItem();
+
+ item.MapPropertiesTo(remote, MappingFlags.All);
+
+ return remote;
+ }
+
#endregion
#region Proto Handlers