Jelajahi Sumber

Added ToObjects for enumerators of CoreRow

Kenric Nugteren 1 tahun lalu
induk
melakukan
cecbe21f1f
1 mengubah file dengan 9 tambahan dan 0 penghapusan
  1. 9 0
      InABox.Core/CoreTable/CoreRow.cs

+ 9 - 0
InABox.Core/CoreTable/CoreRow.cs

@@ -257,4 +257,13 @@ namespace InABox.Core
         }
 
     }
+
+    public static class CoreRowExtensions
+    {
+        public static IEnumerable<T> ToObjects<T>(this IEnumerable<CoreRow> rows)
+            where T : BaseObject, new()
+        {
+            return rows.Select(x => x.ToObject<T>());
+        }
+    }
 }