Selaa lähdekoodia

Fixed RestHandler for non IPersistent entities

Kenric Nugteren 1 viikko sitten
vanhempi
commit
80b31e289e
1 muutettua tiedostoa jossa 4 lisäystä ja 5 poistoa
  1. 4 5
      InABox.Server/Rest/RestHandler.cs

+ 4 - 5
InABox.Server/Rest/RestHandler.cs

@@ -333,15 +333,14 @@ namespace InABox.API
             return new ValueTask<IResponse?>(request.Respond().Status(ResponseStatus.NotFound).Build());
         }
 
-        private Dictionary<string, Type>? _persistentRemotable;
+        private Dictionary<string, Type>? _remotable;
 
         private Type? GetEntity(string entityName)
         {
-            _persistentRemotable ??= CoreUtils.TypeList(
+            _remotable ??= CoreUtils.TypeList(
                 e => e.IsSubclassOf(typeof(Entity)) &&
-                     e.GetInterfaces().Contains(typeof(IRemotable)) &&
-                     e.GetInterfaces().Contains(typeof(IPersistent))).ToDictionary(x => x.Name, x => x);
-            return _persistentRemotable.GetValueOrDefault(entityName);
+                     e.GetInterfaces().Contains(typeof(IRemotable))).ToDictionary(x => x.Name, x => x);
+            return _remotable.GetValueOrDefault(entityName);
         }
 
         #endregion