< Summary

Information
Class: Fluorite.Strainer.Models.Metadata.PropertyMetadata
Assembly: Fluorite.Strainer
File(s): /builds/fluorite/strainer/src/Strainer/Models/Metadata/PropertyMetadata.cs
Line coverage
100%
Covered lines: 11
Uncovered lines: 0
Coverable lines: 11
Total lines: 66
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%
get_DisplayName()100%11100%
get_IsDefaultSorting()100%11100%
get_DefaultSortingWay()100%11100%
get_IsFilterable()100%11100%
get_IsSortable()100%11100%
get_Name()100%11100%
get_PropertyInfo()100%11100%

File(s)

/builds/fluorite/strainer/src/Strainer/Models/Metadata/PropertyMetadata.cs

#LineLine coverage
 1using Fluorite.Strainer.Models.Sorting;
 2using System.Diagnostics;
 3using System.Reflection;
 4
 5namespace Fluorite.Strainer.Models.Metadata;
 6
 7/// <summary>
 8/// Represents default property metadata model.
 9/// </summary>
 10[DebuggerDisplay("\\{" + nameof(Name) + " = " + "{" + nameof(Name) + "} \\}")]
 11public class PropertyMetadata : IPropertyMetadata
 12{
 13    /// <summary>
 14    /// Initializes a new instance of the <see cref="PropertyMetadata"/> class.
 15    /// </summary>
 16    /// <param name="name">
 17    /// The property name.
 18    /// </param>
 19    /// <param name="propertyInfo">
 20    /// The property info instance for the property.
 21    /// </param>
 4222    public PropertyMetadata(string name, PropertyInfo propertyInfo)
 23    {
 4224        Name = Guard.Against.NullOrWhiteSpace(name);
 4225        PropertyInfo = Guard.Against.Null(propertyInfo);
 4226    }
 27
 28    /// <summary>
 29    /// Gets or sets the display name of the property.
 30    /// </summary>
 6431    public string? DisplayName { get; set; }
 32
 33    /// <summary>
 34    /// Gets or sets a value indicating whether related
 35    /// property should be used as a default (fallback) property when
 36    /// no sorting information was provided but sorting was still requested.
 37    /// <para/>
 38    /// Default sorting is not perfomed when sorting information is not
 39    /// properly recognized.
 40    /// </summary>
 8341    public bool IsDefaultSorting { get; set; }
 42
 43    /// <summary>
 44    /// Gets or sets default sorting way used when related property is marked
 45    /// as a default sorting property.
 46    /// </summary>
 5447    public SortingWay? DefaultSortingWay { get; set; }
 48
 49    /// <summary>
 50    /// Gets or sets a value indicating whether related
 51    /// property is marked as filterable for Strainer.
 52    /// </summary>
 5453    public bool IsFilterable { get; set; }
 54
 55    /// <summary>
 56    /// Gets or sets a value indicating whether related
 57    /// property is marked as sortable for Strainer.
 58    /// </summary>
 5759    public bool IsSortable { get; set; }
 60
 61    /// <inheritdoc/>
 4262    public string Name { get; }
 63
 64    /// <inheritdoc/>
 2165    public PropertyInfo PropertyInfo { get; }
 66}