Browse Source

Utility functions

Kenric Nugteren 1 year ago
parent
commit
7dc558b721
2 changed files with 11 additions and 0 deletions
  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);
             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)
         public static void Save<TEntity>(TEntity entity, string auditNote)
             where TEntity : Entity, IRemotable, IPersistent, new()
             where TEntity : Entity, IRemotable, IPersistent, new()
         {
         {

+ 5 - 0
InABox.Core/CoreUtils.cs

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