Преглед изворни кода

Added ToObjects for enumerators of CoreRow

Kenric Nugteren пре 1 година
родитељ
комит
cecbe21f1f
1 измењених фајлова са 9 додато и 0 уклоњено
  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>());
+        }
+    }
 }