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

loresoft / FluentCommand / 23256000174

18 Mar 2026 04:13PM UTC coverage: 56.658% (+0.2%) from 56.486%
23256000174

push

github

pwelter34
Add SQL Server structured parameter support

1303 of 2875 branches covered (45.32%)

Branch coverage included in aggregate %.

106 of 149 new or added lines in 8 files covered. (71.14%)

6 existing lines in 1 file now uncovered.

3969 of 6430 relevant lines covered (61.73%)

361.39 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
    {
UNCOV
29
        if (source == null)
×
30
            return null;
×
31

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

UNCOV
34
        var dataTable = new DataTable();
×
UNCOV
35
        dataTable.Load(dataReader);
×
36

UNCOV
37
        return dataTable;
×
UNCOV
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