< Summary

Information
Class: MyNet.Observable.Validation.LocalizedRuleBuilder<T1, T2>
Assembly: MyNet.Observable
File(s): https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Observable/Validation/LocalizedRuleBuilder.cs
Tag: 323_28699572109
Line coverage
100%
Covered lines: 2
Uncovered lines: 0
Coverable lines: 2
Total lines: 28
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%

File(s)

https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Observable/Validation/LocalizedRuleBuilder.cs

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="LocalizedRuleBuilder.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7using FluentValidation;
 8
 9#pragma warning disable IDE0130 // Namespace does not match folder structure
 10namespace MyNet.Observable.Validation;
 11#pragma warning restore IDE0130 // Namespace does not match folder structure
 12
 13/// <summary>
 14/// Wraps a FluentValidation rule with a resolved property display key for localized messages.
 15/// </summary>
 16public sealed class LocalizedRuleBuilder<T, TProperty>(IRuleBuilder<T, TProperty> ruleBuilder, string propertyDisplayKey
 17{
 18    /// <summary>
 19    /// Gets the underlying FluentValidation rule builder.
 20    /// </summary>
 3021    public IRuleBuilder<T, TProperty> RuleBuilder { get; } = ruleBuilder;
 22
 23    /// <summary>
 24    /// Gets the translation key used as {0} in validation message templates.
 25    /// </summary>
 3026    public string PropertyDisplayKey { get; } = propertyDisplayKey;
 27}
 28