diff options
| author | Rob Mensching <rob@firegiant.com> | 2017-11-01 10:59:45 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2017-11-01 10:59:45 -0700 |
| commit | 2bb37beda887d120a0ddabf874ad25357101faa1 (patch) | |
| tree | c35e97b03274b86cfc9ff7fd2caeee211165a140 /src/WixToolset.Data.WindowsInstaller/TableExtensions.cs | |
| parent | df7413aeed3aea3425dff20ae0c8b1be3a3ab525 (diff) | |
| download | wix-2bb37beda887d120a0ddabf874ad25357101faa1.tar.gz wix-2bb37beda887d120a0ddabf874ad25357101faa1.tar.bz2 wix-2bb37beda887d120a0ddabf874ad25357101faa1.zip | |
Update to WiX Intermediate Representation
Diffstat (limited to 'src/WixToolset.Data.WindowsInstaller/TableExtensions.cs')
| -rw-r--r-- | src/WixToolset.Data.WindowsInstaller/TableExtensions.cs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/WixToolset.Data.WindowsInstaller/TableExtensions.cs b/src/WixToolset.Data.WindowsInstaller/TableExtensions.cs new file mode 100644 index 00000000..1be64ffe --- /dev/null +++ b/src/WixToolset.Data.WindowsInstaller/TableExtensions.cs | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | // 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. | ||
| 2 | |||
| 3 | namespace WixToolset.Data | ||
| 4 | { | ||
| 5 | using System.Collections.Generic; | ||
| 6 | using System.Linq; | ||
| 7 | |||
| 8 | /// <summary> | ||
| 9 | /// Methods that extend <see cref="Table"/>. | ||
| 10 | /// </summary> | ||
| 11 | public static class TableExtensions | ||
| 12 | { | ||
| 13 | /// <summary> | ||
| 14 | /// Gets the rows contained in the table as a particular row type. | ||
| 15 | /// </summary> | ||
| 16 | /// <param name="table">Table to get rows from.</param> | ||
| 17 | /// <remarks>If the <paramref name="table"/> is null, an empty enumerable will be returned.</remarks> | ||
| 18 | public static IEnumerable<T> RowsAs<T>(this Table table) where T : Row | ||
| 19 | { | ||
| 20 | return (null == table) ? Enumerable.Empty<T>() : table.Rows.Cast<T>(); | ||
| 21 | } | ||
| 22 | } | ||
| 23 | } | ||
