aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.BL
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2025-08-16 20:46:30 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2025-08-16 20:46:30 +0300
commit5282624fc0f2ba7b5191219a0e941c9b53d1843b (patch)
treef4dc6603a125727a59ef956cc05a8dd4b8e2779d /Software/Visual_Studio/Tango.BL
parente9f317178f6454836d488cf1e65d04b20b02d334 (diff)
downloadTango-5282624fc0f2ba7b5191219a0e941c9b53d1843b.tar.gz
Tango-5282624fc0f2ba7b5191219a0e941c9b53d1843b.zip
Telemetry Logs & Machine Updates.
Diffstat (limited to 'Software/Visual_Studio/Tango.BL')
-rw-r--r--Software/Visual_Studio/Tango.BL/Entities/TangoUpdate.cs9
-rw-r--r--Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs8
2 files changed, 15 insertions, 2 deletions
diff --git a/Software/Visual_Studio/Tango.BL/Entities/TangoUpdate.cs b/Software/Visual_Studio/Tango.BL/Entities/TangoUpdate.cs
index 867665f89..f3b0237d8 100644
--- a/Software/Visual_Studio/Tango.BL/Entities/TangoUpdate.cs
+++ b/Software/Visual_Studio/Tango.BL/Entities/TangoUpdate.cs
@@ -12,6 +12,8 @@ namespace Tango.BL.Entities
{
public class TangoUpdate : TangoUpdateBase
{
+ public static event EventHandler<TangoUpdate> TangoUpdateSaved;
+
[NotMapped]
[JsonIgnore]
public TangoUpdateStatuses UpdateStatus
@@ -166,5 +168,12 @@ namespace Tango.BL.Entities
base.OnStatusChanged(status);
RaisePropertyChanged(nameof(UpdateStatus));
}
+
+ public override void OnBeforeSave()
+ {
+ base.OnBeforeSave();
+
+ TangoUpdateSaved?.Invoke(this, this);
+ }
}
}
diff --git a/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs b/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs
index 3d330b797..6bacf610b 100644
--- a/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs
+++ b/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs
@@ -133,9 +133,13 @@ namespace Tango.BL
{
foreach (var entity in ChangeTracker.Entries().Where(x => x.State == EntityState.Added || x.State == EntityState.Modified).ToList())
{
- if (entity is IObservableEntity && entity != null)
+ if (entity is IObservableEntity en)
{
- (entity as IObservableEntity).OnBeforeSave();
+ en?.OnBeforeSave();
+ }
+ else if (entity.Entity is IObservableEntity en2)
+ {
+ en2?.OnBeforeSave();
}
}