Class RuleBuilderInitialExtensions

Namespace
Cratis.Arc.Validation
Assembly
Cratis.Arc.Core.dll

Extensions for working with FluentValidation.IRuleBuilderInitial<T, TProperty>.

public static class RuleBuilderInitialExtensions
Inheritance
RuleBuilderInitialExtensions
Inherited Members

Methods

OverridePropertyName<T, TProperty>(IRuleBuilderInitial<T, TProperty>, string)

Overrides the property name for the rule.

public static IRuleBuilderInitial<T, TProperty> OverridePropertyName<T, TProperty>(this IRuleBuilderInitial<T, TProperty> ruleBuilder, string propertyName)

Parameters

ruleBuilder IRuleBuilderInitial<T, TProperty>

The rule builder.

propertyName string

The property name to use.

Returns

IRuleBuilderInitial<T, TProperty>

The same rule builder for chaining.

Type Parameters

T

Type of object being validated.

TProperty

Property type.

Remarks

FluentValidation's own OverridePropertyName is a public extension on FluentValidation.IRuleBuilderOptions<T, TProperty>. The concrete rule builder behind an FluentValidation.IRuleBuilderInitial<T, TProperty> also implements that interface and returns itself, so this simply forwards to it — avoiding the private-member reflection that NativeAOT and trimming cannot preserve.