From 4ebc33174c02e1c9f5693b5ef38ecfe3292c687f Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Fri, 11 Aug 2017 00:39:04 -0700 Subject: Move to .NET Core 2.0 --- src/WixToolset.Data/TableExtensions.cs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/WixToolset.Data/TableExtensions.cs (limited to 'src/WixToolset.Data/TableExtensions.cs') diff --git a/src/WixToolset.Data/TableExtensions.cs b/src/WixToolset.Data/TableExtensions.cs new file mode 100644 index 00000000..1be64ffe --- /dev/null +++ b/src/WixToolset.Data/TableExtensions.cs @@ -0,0 +1,23 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Data +{ + using System.Collections.Generic; + using System.Linq; + + /// + /// Methods that extend . + /// + public static class TableExtensions + { + /// + /// Gets the rows contained in the table as a particular row type. + /// + /// Table to get rows from. + /// If the is null, an empty enumerable will be returned. + public static IEnumerable RowsAs(this Table table) where T : Row + { + return (null == table) ? Enumerable.Empty() : table.Rows.Cast(); + } + } +} -- cgit v1.2.3-55-g6feb