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

loresoft / EntityFrameworkCore.Generator / 15460811637

05 Jun 2025 07:12AM CUT coverage: 54.917%. Remained the same
15460811637

Pull #669

github

web-flow
Merge 7e40b6960 into b2ad58745
Pull Request #669: Bump the azure group with 3 updates

643 of 1333 branches covered (48.24%)

Branch coverage included in aggregate %.

1881 of 3263 relevant lines covered (57.65%)

61.27 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
    {
12
        ArgumentNullException.ThrowIfNull(type);
×
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
    {
25
        ArgumentNullException.ThrowIfNull(type);
×
26

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

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

© 2025 Coveralls, Inc