Selaa lähdekoodia

Utility functions

Kenric Nugteren 1 vuosi sitten
vanhempi
commit
7dc558b721
2 muutettua tiedostoa jossa 11 lisäystä ja 0 poistoa
  1. 6 0
      InABox.Core/Client/Client.cs
  2. 5 0
      InABox.Core/CoreUtils.cs

+ 6 - 0
InABox.Core/Client/Client.cs

@@ -77,6 +77,12 @@ namespace InABox.Clients
             return CheckClient<TEntity>().Query(filter, columns, orderby);
         }
 
+        public static void Query<TEntity>(Filter<TEntity>? filter, Columns<TEntity>? columns, SortOrder<TEntity>? orderby, Action<CoreTable?, Exception?> callback)
+            where TEntity : Entity, IRemotable, IPersistent, new()
+        {
+            CheckClient<TEntity>().Query(filter, columns, orderby, callback);
+        }
+
         public static void Save<TEntity>(TEntity entity, string auditNote)
             where TEntity : Entity, IRemotable, IPersistent, new()
         {

+ 5 - 0
InABox.Core/CoreUtils.cs

@@ -2468,6 +2468,11 @@ namespace InABox.Core
             return string.Join("\n", messages);
         }
 
+        public static void LogException(string userid, Exception err)
+        {
+            Logger.Send(LogType.Error, userid, CoreUtils.FormatException(err));
+        }
+
         #region OneToMany Relationships
 
         public static Type? GetOneToMany(Type TMany, Type TOne)