소스 검색

Added CoreTable.ToGroups() function
Added Server.LicensingEngine enum

frogsoftware 1 년 전
부모
커밋
ea0553d6a2
2개의 변경된 파일10개의 추가작업 그리고 1개의 파일을 삭제
  1. 8 0
      InABox.Core/CoreTable/CoreTable.cs
  2. 2 1
      InABox.Core/Pushes/Platform.cs

+ 8 - 0
InABox.Core/CoreTable/CoreTable.cs

@@ -4,6 +4,8 @@ using System.Collections.Generic;
 using System.Data;
 using System.Linq;
 using System.Linq.Expressions;
+using System.Net.Http.Headers;
+using System.Reflection;
 
 namespace InABox.Core
 {
@@ -422,6 +424,12 @@ namespace InABox.Core
 
         #region ToLookup
 
+        public IEnumerable<IGrouping<TKey, TValue>> ToGroups<T, TKey, TValue>(Expression<Func<T, TKey>> key,
+            Expression<Func<T, TValue>> value)
+        {
+            return Rows.GroupBy(r => r.Get(key), r => r.Get(value));
+        }
+        
         public IMutableLookup<TKey, TValue> ToLookup<T, TKey, TValue>(Expression<Func<T, TKey>> key, Expression<Func<T, TValue>> value,
             Expression<Func<T, object>>? sort = null)
         {

+ 2 - 1
InABox.Core/Pushes/Platform.cs

@@ -12,7 +12,8 @@ namespace InABox.Core
         WebEngine,
         GPSEngine,
         SchedulerEngine,
-        Server
+        Server,
+        LicensingEngine
     }
 
     public static class PlatformUtils