aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.BL/ObservableEntityDTO.cs
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2019-12-20 21:34:50 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2019-12-20 21:34:50 +0200
commit76cdf188e28544cd5056c30f35d77590d9a79cae (patch)
treee83b12220517378e4499dc47c6261f8862f37f46 /Software/Visual_Studio/Tango.BL/ObservableEntityDTO.cs
parent5cb75f4b026a7842171369f58f5aba1c9678f60f (diff)
downloadTango-76cdf188e28544cd5056c30f35d77590d9a79cae.tar.gz
Tango-76cdf188e28544cd5056c30f35d77590d9a79cae.zip
Improvements to ActionLogs.
Implemented ActionLogs for hw comparison.
Diffstat (limited to 'Software/Visual_Studio/Tango.BL/ObservableEntityDTO.cs')
-rw-r--r--Software/Visual_Studio/Tango.BL/ObservableEntityDTO.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.BL/ObservableEntityDTO.cs b/Software/Visual_Studio/Tango.BL/ObservableEntityDTO.cs
index ee8d2f40f..4c5ca6ae4 100644
--- a/Software/Visual_Studio/Tango.BL/ObservableEntityDTO.cs
+++ b/Software/Visual_Studio/Tango.BL/ObservableEntityDTO.cs
@@ -1,12 +1,14 @@
using System;
using System.Collections;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Tango.BL.ActionLogs;
using Tango.BL.ValueObjects;
+using Tango.Core.ExtensionMethods;
namespace Tango.BL
{
@@ -72,6 +74,19 @@ namespace Tango.BL
prop.SetValue(dto, collection);
}
}
+ else if (prop.GetCustomAttribute<ObservableDTOPropertyAttribute>() != null)
+ {
+ var att = prop.GetCustomAttribute<ObservableDTOPropertyAttribute>();
+
+ try
+ {
+ prop.SetValue(dto, observable.GetPropertyValueByPath(att.MapsTo));
+ }
+ catch
+ {
+ Debug.WriteLine($"Error mapping '{typeof(DTO).Name}.{prop.PropertyType}' to '{typeof(T)}.{att.MapsTo}'.");
+ }
+ }
}
return dto;