Show / Hide Table of Contents

Interface IValidationEntry<T>

Defines members to be implemented by a type that allows configuring validation rules for a property.

Namespace: TheXDS.MCART.Types.Base
Assembly: MCART.Mvvm.dll
Syntax
public interface IValidationEntry<T>
Type Parameters
Name Description
T

Type of the selected property.

Methods

| Edit this page View Source

AddRule(Func<T, bool>, string)

Adds a validation rule for the selected property.

Declaration
IValidationEntry<T> AddRule(Func<T, bool> rule, string error)
Parameters
Type Name Description
Func<T, bool> rule

Function that performs the validation. The function must return true if the value passes the test, false otherwise.

string error

Error message to display if the rule fails.

Returns
Type Description
IValidationEntry<T>

The same validation-entry instance to allow Fluent syntax.

| Edit this page View Source

AddRule(Func<T, bool?>, string)

Adds a validation rule for the selected property.

Declaration
IValidationEntry<T> AddRule(Func<T, bool?> rule, string error)
Parameters
Type Name Description
Func<T, bool?> rule

Function that performs the validation. The function must return true if the value passes the test, false otherwise. If the evaluator returns null, evaluation of any remaining rules that have not yet run will stop.

string error

Error message to display if the rule fails.

Returns
Type Description
IValidationEntry<T>

The same validation-entry instance to allow Fluent syntax.

Extension Methods

Objects.ShallowCopyTo(object, object, Type)
ObjectExtensions.FieldsOf<T>(object)
ObjectExtensions.GetAttribute<T>(object)
ObjectExtensions.GetAttributes<T>(object)
ObjectExtensions.HasAttrValue<TAttribute, TValue>(object, out TValue)
ObjectExtensions.HasAttribute<T>(object)
ObjectExtensions.HasAttribute<T>(object, out T?)
ObjectExtensions.HasAttributes<T>(object, out IEnumerable<T>?)
ObjectExtensions.Is(object?, object?)
ObjectExtensions.IsEither(object, IEnumerable)
ObjectExtensions.IsEither(object, params object[])
ObjectExtensions.IsNeither(object, IEnumerable)
ObjectExtensions.IsNeither(object, params object[])
ObjectExtensions.IsNot(object?, object?)
ObjectExtensions.PropertiesOf<T>(object)
ObjectExtensions.WhichAre(object, IEnumerable<object>)
ObjectExtensions.WhichAre(object, params object[])
Common.IfNotNull<T>(T?, Action<T>)
Objects.Itself<T>(T)
Objects.ShallowCopyTo<T>(T, T)
CollectionExtensions.PushInto<TItem, TCollection>(TItem, ICollection<TCollection>)
DictionaryExtensions.PushInto<TKey, TValue>(TValue, TKey, IDictionary<TKey, TValue>)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX