Quantcast
Channel: Fluent Validation for .NET
Viewing all articles
Browse latest Browse all 1917

New Post: Convention-Based Localization With Branding

$
0
0
My prior response was based on trying the following code:
var options = ruleBuilder.SetValidator(new RegexValidator()) as IConfigurable<PropertyRule, IRuleBuilderOptions<T, TElement>>;
I don't know how to make the cast any more explicit. When I check the signatures available on the 'options' variable, I see only these:

Equals()
GetHashCode()
GetType()
ToString()

No Configure() method. :(

When I look at the IConfigurable interface in the Visual Studio object browser, it shows no signatures at all. When I hit 'F12' on the interface in Visual Studio, it brings up the following definition, which shows the signature being private:
//Assembly FluentValidation.dll, v5.1.0.0

using System;
using System.ComponentModel;

namespace FluentValidation.Internal
{
    // Summary:
    //     Represents an object that is configurable.
    //
    // Type parameters:
    //   TConfiguration:
    //     Type of object being configured
    //
    //   TNext:
    //     Return type
    public interface IConfigurable<TConfiguration, out TNext>
    {
        // Summary:
        //     Configures the current object.
        //
        // Parameters:
        //   configurator:
        //     Action to configure the object.
        [EditorBrowsable(EditorBrowsableState.Never)]
        TNext Configure(Action<TConfiguration> configurator);
    }
}
What can we check next?

Viewing all articles
Browse latest Browse all 1917

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>