< Summary

Information
Class: MyNet.Metadata.TypeMetadata
Assembly: MyNet.Metadata
File(s): https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Metadata/TypeMetadata.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
.ctor()100%11100%
GetProperty(...)100%11100%

File(s)

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

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="TypeMetadata.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7using System;
 8using System.Collections.Concurrent;
 9
 10namespace MyNet.Metadata;
 11
 12/// <summary>
 13/// Represents metadata associated with a type. This class is used to store and manage metadata for a specific type, all
 14/// </summary>
 15public sealed class TypeMetadata
 16{
 17    /// <summary>
 18    /// Gets the dictionary of property metadata for the type. This dictionary allows for the storage and retrieval of m
 19    /// </summary>
 45020    public ConcurrentDictionary<string, PropertyMetadata> Properties { get; } = new(StringComparer.Ordinal);
 21
 22    /// <summary>
 23    /// Gets the metadata for the specified property name. This method checks if there is metadata associated with the p
 24    /// </summary>
 25    /// <param name="name">The name of the property for which to retrieve metadata.</param>
 26    /// <returns>The <see cref="PropertyMetadata"/> instance associated with the specified property name.</returns>
 613827    public PropertyMetadata GetProperty(string name) => Properties.GetOrAdd(name, static _ => new());
 28}
 29

Methods/Properties

.ctor()
GetProperty(System.String)