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

loresoft / FluentCommand / 36888666826

01 Oct 2026 04:00PM UTC coverage: 61.179% (-4.7%) from 65.903%
36888666826

push

github

pwelter34
Improve MERGE SQL generation and literals

1624 of 3516 branches covered (46.19%)

Branch coverage included in aggregate %.

49 of 70 new or added lines in 1 file covered. (70.0%)

373 existing lines in 32 files now uncovered.

5422 of 8001 relevant lines covered (67.77%)

292.72 hits per line

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

55.56
/src/FluentCommand/Extensions/TypeExtensions.cs
1
namespace FluentCommand.Extensions;
2

3
/// <summary>
4
/// <see cref="T:Type"/> extension methods.
5
/// </summary>
6
public static class TypeExtensions
7
{
8
    /// <summary>
9
    /// Gets the underlying type dealing with <see cref="T:Nullable`1"/>.
10
    /// </summary>
11
    /// <param name="type">The type.</param>
12
    /// <returns>Returns a type dealing with <see cref="T:Nullable`1"/>.</returns>
13
    public static Type GetUnderlyingType(this Type type)
14
    {
15
        ArgumentNullException.ThrowIfNull(type);
5,329 ✔
16

17
        return Nullable.GetUnderlyingType(type) ?? type;
5,329 ✔
18
    }
19

20
    /// <summary>
21
    /// Determines whether the specified <paramref name="type"/> can be null.
22
    /// </summary>
23
    /// <param name="type">The type to check.</param>
24
    /// <returns>
25
    ///   <c>true</c> if the specified <paramref name="type"/> can be null; otherwise, <c>false</c>.
26
    /// </returns>
27
    public static bool IsNullable(this Type type)
28
    {
29
        ArgumentNullException.ThrowIfNull(type);
21 ✔
30

31
        if (!type.IsValueType)
21 !
UNCOV
32
            return true;
×
33

34
        return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>);
21 ✔
35
    }
36

37
    /// <summary>
38
    /// Gets the default value the specified <paramref name="type"/>.
39
    /// </summary>
40
    /// <param name="type">The type to get a default value for.</param>
41
    /// <returns>A default value the specified <paramref name="type"/>.</returns>
42
    public static object? Default(this Type type)
43
    {
44
        ArgumentNullException.ThrowIfNull(type);
×
45

46
        return type.IsValueType
×
47
          ? Activator.CreateInstance(type)
×
48
          : null;
×
49
    }
50
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc