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

loresoft / EntityFrameworkCore.Generator / 15284975195

27 May 2025 08:21PM UTC coverage: 55.036% (+0.2%) from 54.862%
15284975195

push

github

pwelter34
remove VB support, cleanup ToType

638 of 1315 branches covered (48.52%)

Branch coverage included in aggregate %.

65 of 83 new or added lines in 4 files covered. (78.31%)

1859 of 3222 relevant lines covered (57.7%)

61.23 hits per line

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

0.0
/src/EntityFrameworkCore.Generator.Core/Extensions/TypeExtensions.cs
1
namespace EntityFrameworkCore.Generator.Extensions;
2

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

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

NEW
27
        if (!type.IsGenericType || type.IsGenericTypeDefinition)
×
NEW
28
            return false;
×
29

30
        // Instantiated generic type only
NEW
31
        Type genericType = type.GetGenericTypeDefinition();
×
NEW
32
        return ReferenceEquals(genericType, typeof(Nullable<>));
×
33
    }
34
}
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