diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-12-17 20:04:34 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-12-17 20:04:34 +0200 |
| commit | 74d6b86d46819376f0389d6fd4055e40e4e01598 (patch) | |
| tree | 02ac8b53c283aca235a116dde8c6e1027ea3edad /Software/Visual_Studio/Tango.BL/ObservableEntity.cs | |
| parent | 2d148c9f0de61bc09fbab89341dc05b82e45f78a (diff) | |
| download | Tango-74d6b86d46819376f0389d6fd4055e40e4e01598.tar.gz Tango-74d6b86d46819376f0389d6fd4055e40e4e01598.zip | |
Started working on Action Logs !!!
Diffstat (limited to 'Software/Visual_Studio/Tango.BL/ObservableEntity.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.BL/ObservableEntity.cs | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.BL/ObservableEntity.cs b/Software/Visual_Studio/Tango.BL/ObservableEntity.cs index 4f03263d9..11aca0e99 100644 --- a/Software/Visual_Studio/Tango.BL/ObservableEntity.cs +++ b/Software/Visual_Studio/Tango.BL/ObservableEntity.cs @@ -27,6 +27,8 @@ using Tango.Core.Json; using Newtonsoft.Json.Converters; using Tango.BL.Serialization; using Newtonsoft.Json.Linq; +using Tango.BL.ActionLogs; +using Tango.BL.ValueObjects; namespace Tango.BL { @@ -50,7 +52,7 @@ namespace Tango.BL /// <seealso cref="Tango.Core.ExtendedObject" /> /// <seealso cref="Tango.BL.Entities.IObservableEntity" /> [Serializable] - public abstract class ObservableEntity<T> : ExtendedObject, IObservableEntity where T : class, IObservableEntity + public abstract class ObservableEntity<T> : ExtendedObject, IObservableEntity, IActionLogComparable<T> where T : class, IObservableEntity { #region Events @@ -658,5 +660,29 @@ namespace Tango.BL } #endregion + + #region Action Log + + public Task<List<ActionLogDifference>> CompareTo(T before) + { + return new BasicActionLogComparer().Compare(before as IActionLogComparable, this); + } + + Task<List<ActionLogDifference>> IActionLogComparable.CompareTo(IActionLogComparable before) + { + return CompareTo(before as T); + } + + bool IActionLogComparable.ShouldActionLogIgnore(string propName) + { + return propName == nameof(LastUpdated) || OnShouldActionLogIgnore(propName); + } + + protected virtual bool OnShouldActionLogIgnore(string propName) + { + return false; + } + + #endregion } } |
