Forráskód Böngészése

Fixed deleting objects with donotpersist properties

Kenric Nugteren 1 éve
szülő
commit
cd5bc3e263
1 módosított fájl, 3 hozzáadás és 0 törlés
  1. 3 0
      InABox.Core/Deletion.cs

+ 3 - 0
InABox.Core/Deletion.cs

@@ -2,6 +2,7 @@
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Linq;
 using System.Linq;
+using System.Reflection;
 using System.Text;
 using System.Text;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 
 
@@ -32,6 +33,8 @@ namespace InABox.Core
         private static bool IsDeletionColumn(IProperty property)
         private static bool IsDeletionColumn(IProperty property)
         {
         {
             if (property.IsCalculated) return false;
             if (property.IsCalculated) return false;
+            if (property is StandardProperty standardProperty && standardProperty.Property.GetCustomAttribute<DoNotPersist>() != null)
+                return false;
             if (property.Parent is null) return true;
             if (property.Parent is null) return true;
             if (property.Parent.IsEntityLink && !property.Name.EndsWith(".ID")) return false;
             if (property.Parent.IsEntityLink && !property.Name.EndsWith(".ID")) return false;
             if (property.Parent.HasParentEntityLink()) return false;
             if (property.Parent.HasParentEntityLink()) return false;