| | | 1 | | // ----------------------------------------------------------------------- |
| | | 2 | | // <copyright file="TypeMetadata.cs" company="Stéphane ANDRE"> |
| | | 3 | | // Copyright (c) Stéphane ANDRE. All rights reserved. |
| | | 4 | | // </copyright> |
| | | 5 | | // ----------------------------------------------------------------------- |
| | | 6 | | |
| | | 7 | | using System; |
| | | 8 | | using System.Collections.Concurrent; |
| | | 9 | | |
| | | 10 | | namespace 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> |
| | | 15 | | public 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> |
| | 450 | 20 | | 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> |
| | 6138 | 27 | | public PropertyMetadata GetProperty(string name) => Properties.GetOrAdd(name, static _ => new()); |
| | | 28 | | } |
| | | 29 | | |