Browse Source

Added ToObjects for enumerators of CoreRow

Kenric Nugteren 1 year ago
parent
commit
cecbe21f1f
1 changed files with 9 additions and 0 deletions
  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>());
+        }
+    }
 }
 }