• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

loresoft / FluentCommand / 23278216331

19 Mar 2026 03:19AM UTC coverage: 57.398% (+0.7%) from 56.658%
23278216331

push

github

pwelter34
Enable nullable and improve source generators

1403 of 3069 branches covered (45.72%)

Branch coverage included in aggregate %.

527 of 907 new or added lines in 58 files covered. (58.1%)

22 existing lines in 10 files now uncovered.

4288 of 6846 relevant lines covered (62.64%)

330.58 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/FluentCommand/Extensions/DataTableExtensions.cs
1
using System.Data;
2

3
namespace FluentCommand.Extensions;
4

5
/// <summary>
6
/// Provides extension methods for the <see cref="DataTable"/> class.
7
/// </summary>
8
public static class DataTableExtensions
9
{
10
    /// <summary>
11
    /// Converts an <see cref="IEnumerable{T}"/> to a <see cref="DataTable"/> instance.
12
    /// </summary>
13
    /// <typeparam name="T">The type of the elements in the source collection.</typeparam>
14
    /// <param name="source">The collection of objects to convert to a <see cref="DataTable"/>.</param>
15
    /// <param name="ignoreNames">
16
    /// An optional collection of property names to ignore when creating columns in the <see cref="DataTable"/>.
17
    /// If <c>null</c>, all public properties are included.
18
    /// </param>
19
    /// <returns>
20
    /// A <see cref="DataTable"/> populated with the data from the <paramref name="source"/> collection,
21
    /// or <c>null</c> if <paramref name="source"/> is <c>null</c>.
22
    /// </returns>
23
    /// <remarks>
24
    /// This method uses <see cref="ListDataReader{T}"/> to read the data from the source collection and load it into a <see cref="DataTable"/>.
25
    /// </remarks>
26
    public static DataTable ToDataTable<T>(this IEnumerable<T> source, IEnumerable<string>? ignoreNames = null)
27
        where T : class
28
    {
NEW
29
        var dataTable = new DataTable();
×
30
        if (source == null)
×
NEW
31
            return dataTable;
×
32

33
        using var dataReader = new ListDataReader<T>(source, ignoreNames);
×
34

35
        dataTable.Load(dataReader);
×
36

37
        return dataTable;
×
38
    }
×
39
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc