< Summary

Information
Class: MyNet.Metadata.TypeExtensions
Assembly: MyNet.Metadata
File(s): https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Metadata/Extensions/TypeExtensions.cs
Tag: 323_28699572109
Line coverage
100%
Covered lines: 2
Uncovered lines: 0
Coverable lines: 2
Total lines: 29
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
GetMetadata(...)100%11100%

File(s)

https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Metadata/Extensions/TypeExtensions.cs

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="TypeExtensions.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7using System;
 8
 9#pragma warning disable IDE0130 // Namespace does not match folder structure
 10namespace MyNet.Metadata;
 11#pragma warning restore IDE0130 // Namespace does not match folder structure
 12
 13public static class TypeExtensions
 14{
 15    extension(Type type)
 16    {
 17        /// <summary>
 18        /// Retrieves the metadata associated with the specified type from <see cref="MetadataRegistry"/>.
 19        /// </summary>
 20        /// <returns>The TypeMetadata associated with the specified type.</returns>
 21        public TypeMetadata GetMetadata()
 22        {
 323            ArgumentNullException.ThrowIfNull(type);
 24
 325            return MetadataRegistry.Get(type);
 26        }
 27    }
 28}
 29

Methods/Properties

GetMetadata(System.Type)