ExpressiveAnnotations.Analysis Namespace

ExpressiveAnnotations API
ExpressiveAnnotations.Analysis Namespace
Namespace provides logic related to lexical and syntactic analysis of specified expressions.
Classes
 | Class | Description
Public class | Lexer | Performs the lexical analysis of a specified logical expression.
Public class | Location | Contains the location information related to some arbitrary data within associated text block. Used for pointing exact parsing error location in specified expression.
Public class | Parser | Performs the syntactic analysis of a specified logical expression within given context.
Public class | Token | Token definition.
Enumerations
 | Enumeration | Description
Public enumeration | TokenType | Token type.


Lexer Class

Lexer Class
Performs the lexical analysis of a specified logical expression.
Inheritance Hierarchy
SystemObject
ExpressiveAnnotations.AnalysisLexer

Namespace: ExpressiveAnnotations.Analysis
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public sealed class Lexer
Public NotInheritable Class Lexer
public ref class Lexer sealed
[<SealedAttribute>]
type Lexer =  class end

The Lexer type exposes the following members.

Constructors
 | Name | Description
Public method | Lexer | Initializes a new instance of the Lexer class.
Top
Methods
 | Name | Description
Public method | Analyze | Analyzes a specified logical expression and extracts a sequence of tokens.
Top
Remarks
Type is thread safe.
See Also

Reference

ExpressiveAnnotations.Analysis Namespace


Lexer Constructor

Lexer Constructor
Initializes a new instance of the Lexer class.

Namespace: ExpressiveAnnotations.Analysis
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public Lexer()
Public Sub New
public:
Lexer()
new : unit -> Lexer
See Also

Reference

Lexer Class
ExpressiveAnnotations.Analysis Namespace


Lexer Methods

Lexer Methods

The Lexer type exposes the following members.

Methods
 | Name | Description
Public method | Analyze | Analyzes a specified logical expression and extracts a sequence of tokens.
Top
See Also

Reference

Lexer Class
ExpressiveAnnotations.Analysis Namespace


Lexer.Analyze Method

LexerAnalyze Method
Analyzes a specified logical expression and extracts a sequence of tokens.

Namespace: ExpressiveAnnotations.Analysis
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public IEnumerable<Token> Analyze(
    string expression
)
Public Function Analyze (
    expression As String
) As IEnumerable(Of Token)
public:
IEnumerable<Token^>^ Analyze(
    String^ expression
)
member Analyze :
        expression : string -> IEnumerable<Token>

Parameters

expression
Type: SystemString
The logical expression.

Return Value

Type: IEnumerable Token
A sequence of extracted tokens.
Exceptions
Exception | Condition
ArgumentNullException | expression;Expression not provided.
See Also

Reference

Lexer Class
ExpressiveAnnotations.Analysis Namespace


Location Class

Location Class
Contains the location information related to some arbitrary data within associated text block.

Used for pointing exact parsing error location in specified expression.

Inheritance Hierarchy
SystemObject
ExpressiveAnnotations.AnalysisLocation

Namespace: ExpressiveAnnotations.Analysis
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
[SerializableAttribute]
public class Location
<SerializableAttribute>
Public Class Location
[SerializableAttribute]
public ref class Location
[<SerializableAttribute>]
type Location =  class end

The Location type exposes the following members.

Constructors
 | Name | Description
Public method | Location(Location) | Initializes a new instance of the Location class.
Public method | Location(Int32, Int32) | Initializes a new instance of the Location class.
Top
Properties
 | Name | Description
Public property | Column | Gets or sets the column number.
Public property | Line | Gets or sets the line number.
Top
See Also

Reference

ExpressiveAnnotations.Analysis Namespace


Location Constructor

Location Constructor
Overload List
 | Name | Description
Public method | Location(Location) | Initializes a new instance of the Location class.
Public method | Location(Int32, Int32) | Initializes a new instance of the Location class.
Top
See Also

Reference

Location Class
ExpressiveAnnotations.Analysis Namespace


Location Constructor (Location)

Location Constructor (Location)
Initializes a new instance of the Location class.

Namespace: ExpressiveAnnotations.Analysis
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public Location(
    Location location
)
Public Sub New (
    location As Location
)
public:
Location(
    Location^ location
)
new :
        location : Location -> Location

Parameters

location
Type: ExpressiveAnnotations.AnalysisLocation
The location.
See Also

Reference

Location Class
Location Overload
ExpressiveAnnotations.Analysis Namespace


Location Constructor (Int32, Int32)

Location Constructor (Int32, Int32)
Initializes a new instance of the Location class.

Namespace: ExpressiveAnnotations.Analysis
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public Location(
    int line,
    int column
)
Public Sub New (
    line As Integer,
    column As Integer
)
public:
Location(
    int line,
    int column
)
new :
        line : int *
        column : int -> Location

Parameters

line
Type: SystemInt32
The line number.
column
Type: SystemInt32
The column number.
See Also

Reference

Location Class
Location Overload
ExpressiveAnnotations.Analysis Namespace


Location Properties

Location Properties

The Location type exposes the following members.

Properties
 | Name | Description
Public property | Column | Gets or sets the column number.
Public property | Line | Gets or sets the line number.
Top
See Also

Reference

Location Class
ExpressiveAnnotations.Analysis Namespace


Location.Column Property

LocationColumn Property
Gets or sets the column number.

Namespace: ExpressiveAnnotations.Analysis
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public int Column { get; set; }
Public Property Column As Integer
    Get
    Set
public:
property int Column {
    int get ();
    void set (int value);
}
member Column : int with get, set

Property Value

Type: Int32
See Also

Reference

Location Class
ExpressiveAnnotations.Analysis Namespace


Location.Line Property

LocationLine Property
Gets or sets the line number.

Namespace: ExpressiveAnnotations.Analysis
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public int Line { get; set; }
Public Property Line As Integer
    Get
    Set
public:
property int Line {
    int get ();
    void set (int value);
}
member Line : int with get, set

Property Value

Type: Int32
See Also

Reference

Location Class
ExpressiveAnnotations.Analysis Namespace


Parser Class

Parser Class
Performs the syntactic analysis of a specified logical expression within given context.
Inheritance Hierarchy
SystemObject
ExpressiveAnnotations.AnalysisParser

Namespace: ExpressiveAnnotations.Analysis
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public sealed class Parser
Public NotInheritable Class Parser
public ref class Parser sealed
[<SealedAttribute>]
type Parser =  class end

The Parser type exposes the following members.

Constructors
 | Name | Description
Public method | Parser | Initializes a new instance of the Parser class.
Top
Methods
 | Name | Description
Public method | AddFunctionTResult(String, ExpressionFuncTResult) | Registers function signature for the parser.
Public method | AddFunctionTArg1, TResult(String, ExpressionFuncTArg1, TResult) | Registers function signature for the parser.
Public method | AddFunctionTArg1, TArg2, TResult(String, ExpressionFuncTArg1, TArg2, TResult) | Registers function signature for the parser.
Public method | AddFunctionTArg1, TArg2, TArg3, TResult(String, ExpressionFuncTArg1, TArg2, TArg3, TResult) | Registers function signature for the parser.
Public method | AddFunctionTArg1, TArg2, TArg3, TArg4, TResult(String, ExpressionFuncTArg1, TArg2, TArg3, TArg4, TResult) | Registers function signature for the parser.
Public method | AddFunctionTArg1, TArg2, TArg3, TArg4, TArg5, TResult(String, ExpressionFuncTArg1, TArg2, TArg3, TArg4, TArg5, TResult) | Registers function signature for the parser.
Public method | AddFunctionTArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult(String, ExpressionFuncTArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult) | Registers function signature for the parser.
Public method | GetConsts | Gets names and values of constants extracted from specified expression within given context.
Public method | GetFields | Gets names and types of properties extracted from specified expression within given context.
Public method | Parse(Type, String) | Parses a specified logical expression into expression tree within given context.
Public method | ParseTContext(String) | Parses a specified logical expression into expression tree within given context.
Top
Remarks
Type is thread safe.
See Also

Reference

ExpressiveAnnotations.Analysis Namespace


Parser Constructor

Parser Constructor
Initializes a new instance of the Parser class.

Namespace: ExpressiveAnnotations.Analysis
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public Parser()
Public Sub New
public:
Parser()
new : unit -> Parser
See Also

Reference

Parser Class
ExpressiveAnnotations.Analysis Namespace


Parser Methods

Parser Methods

The Parser type exposes the following members.

Methods
 | Name | Description
Public method | AddFunctionTResult(String, ExpressionFuncTResult) | Registers function signature for the parser.
Public method | AddFunctionTArg1, TResult(String, ExpressionFuncTArg1, TResult) | Registers function signature for the parser.
Public method | AddFunctionTArg1, TArg2, TResult(String, ExpressionFuncTArg1, TArg2, TResult) | Registers function signature for the parser.
Public method | AddFunctionTArg1, TArg2, TArg3, TResult(String, ExpressionFuncTArg1, TArg2, TArg3, TResult) | Registers function signature for the parser.
Public method | AddFunctionTArg1, TArg2, TArg3, TArg4, TResult(String, ExpressionFuncTArg1, TArg2, TArg3, TArg4, TResult) | Registers function signature for the parser.
Public method | AddFunctionTArg1, TArg2, TArg3, TArg4, TArg5, TResult(String, ExpressionFuncTArg1, TArg2, TArg3, TArg4, TArg5, TResult) | Registers function signature for the parser.
Public method | AddFunctionTArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult(String, ExpressionFuncTArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult) | Registers function signature for the parser.
Public method | GetConsts | Gets names and values of constants extracted from specified expression within given context.
Public method | GetFields | Gets names and types of properties extracted from specified expression within given context.
Public method | Parse(Type, String) | Parses a specified logical expression into expression tree within given context.
Public method | ParseTContext(String) | Parses a specified logical expression into expression tree within given context.
Top
See Also

Reference

Parser Class
ExpressiveAnnotations.Analysis Namespace


Parser.AddFunction Method

ParserAddFunction Method
Overload List
 | Name | Description
Public method | AddFunctionTResult(String, ExpressionFuncTResult) | Registers function signature for the parser.
Public method | AddFunctionTArg1, TResult(String, ExpressionFuncTArg1, TResult) | Registers function signature for the parser.
Public method | AddFunctionTArg1, TArg2, TResult(String, ExpressionFuncTArg1, TArg2, TResult) | Registers function signature for the parser.
Public method | AddFunctionTArg1, TArg2, TArg3, TResult(String, ExpressionFuncTArg1, TArg2, TArg3, TResult) | Registers function signature for the parser.
Public method | AddFunctionTArg1, TArg2, TArg3, TArg4, TResult(String, ExpressionFuncTArg1, TArg2, TArg3, TArg4, TResult) | Registers function signature for the parser.
Public method | AddFunctionTArg1, TArg2, TArg3, TArg4, TArg5, TResult(String, ExpressionFuncTArg1, TArg2, TArg3, TArg4, TArg5, TResult) | Registers function signature for the parser.
Public method | AddFunctionTArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult(String, ExpressionFuncTArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult) | Registers function signature for the parser.
Top
See Also

Reference

Parser Class
ExpressiveAnnotations.Analysis Namespace


Parser.AddFunction(TResult) Method (String, Expression(Func(TResult)))

ParserAddFunctionTResult Method (String, ExpressionFuncTResult)
Registers function signature for the parser.

Namespace: ExpressiveAnnotations.Analysis
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public void AddFunction<TResult>(
    string name,
    Expression<Func<TResult>> func
)

Public Sub AddFunction(Of TResult) (
    name As String,
    func As Expression(Of Func(Of TResult))
)
public:
generic<typename TResult>
void AddFunction(
    String^ name,
    Expression<Func<TResult>^>^ func
)
member AddFunction :
        name : string *
        func : Expression<Func<'TResult>> -> unit

Parameters

name
Type: SystemString
Function name.
func
Type: System.Linq.ExpressionsExpression Func TResult
Function lambda.

Type Parameters

TResult
Type identifier of returned result.
See Also

Reference

Parser Class
AddFunction Overload
ExpressiveAnnotations.Analysis Namespace


Parser.AddFunction(TArg1, TResult) Method (String, Expression(Func(TArg1, TResult)))

ParserAddFunctionTArg1, TResult Method (String, ExpressionFuncTArg1, TResult)
Registers function signature for the parser.

Namespace: ExpressiveAnnotations.Analysis
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public void AddFunction<TArg1, TResult>(
    string name,
    Expression<Func<TArg1, TResult>> func
)

Public Sub AddFunction(Of TArg1, TResult) (
    name As String,
    func As Expression(Of Func(Of TArg1, TResult))
)
public:
generic<typename TArg1, typename TResult>
void AddFunction(
    String^ name,
    Expression<Func<TArg1, TResult>^>^ func
)
member AddFunction :
        name : string *
        func : Expression<Func<'TArg1, 'TResult>> -> unit

Parameters

name
Type: SystemString
Function name.
func
Type: System.Linq.ExpressionsExpression Func TArg1, TResult
Function lambda.

Type Parameters

TArg1
First argument.
TResult
Type identifier of returned result.
See Also

Reference

Parser Class
AddFunction Overload
ExpressiveAnnotations.Analysis Namespace


Parser.AddFunction(TArg1, TArg2, TResult) Method (String, Expression(Func(TArg1, TArg2, TResult)))

ParserAddFunctionTArg1, TArg2, TResult Method (String, ExpressionFuncTArg1, TArg2, TResult)
Registers function signature for the parser.

Namespace: ExpressiveAnnotations.Analysis
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public void AddFunction<TArg1, TArg2, TResult>(
    string name,
    Expression<Func<TArg1, TArg2, TResult>> func
)

Public Sub AddFunction(Of TArg1, TArg2, TResult) (
    name As String,
    func As Expression(Of Func(Of TArg1, TArg2, TResult))
)
public:
generic<typename TArg1, typename TArg2, typename TResult>
void AddFunction(
    String^ name,
    Expression<Func<TArg1, TArg2, TResult>^>^ func
)
member AddFunction :
        name : string *
        func : Expression<Func<'TArg1, 'TArg2, 'TResult>> -> unit

Parameters

name
Type: SystemString
Function name.
func
Type: System.Linq.ExpressionsExpression Func TArg1, TArg2, TResult
Function lambda.

Type Parameters

TArg1
First argument.
TArg2
Second argument.
TResult
Type identifier of returned result.
See Also

Reference

Parser Class
AddFunction Overload
ExpressiveAnnotations.Analysis Namespace


Parser.AddFunction(TArg1, TArg2, TArg3, TResult) Method (String, Expression(Func(TArg1, TArg2, TArg3, TResult)))

ParserAddFunctionTArg1, TArg2, TArg3, TResult Method (String, ExpressionFuncTArg1, TArg2, TArg3, TResult)
Registers function signature for the parser.

Namespace: ExpressiveAnnotations.Analysis
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public void AddFunction<TArg1, TArg2, TArg3, TResult>(
    string name,
    Expression<Func<TArg1, TArg2, TArg3, TResult>> func
)

Public Sub AddFunction(Of TArg1, TArg2, TArg3, TResult) (
    name As String,
    func As Expression(Of Func(Of TArg1, TArg2, TArg3, TResult))
)
public:
generic<typename TArg1, typename TArg2, typename TArg3, typename TResult>
void AddFunction(
    String^ name,
    Expression<Func<TArg1, TArg2, TArg3, TResult>^>^ func
)
member AddFunction :
        name : string *
        func : Expression<Func<'TArg1, 'TArg2, 'TArg3, 'TResult>> -> unit

Parameters

name
Type: SystemString
Function name.
func
Type: System.Linq.ExpressionsExpression Func TArg1, TArg2, TArg3, TResult
Function lambda.

Type Parameters

TArg1
First argument.
TArg2
Second argument.
TArg3
Third argument.
TResult
Type identifier of returned result.
See Also

Reference

Parser Class
AddFunction Overload
ExpressiveAnnotations.Analysis Namespace


Parser.AddFunction(TArg1, TArg2, TArg3, TArg4, TResult) Method (String, Expression(Func(TArg1, TArg2, TArg3, TArg4, TResult)))

ParserAddFunctionTArg1, TArg2, TArg3, TArg4, TResult Method (String, ExpressionFuncTArg1, TArg2, TArg3, TArg4, TResult)
Registers function signature for the parser.

Namespace: ExpressiveAnnotations.Analysis
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public void AddFunction<TArg1, TArg2, TArg3, TArg4, TResult>(
    string name,
    Expression<Func<TArg1, TArg2, TArg3, TArg4, TResult>> func
)

Public Sub AddFunction(Of TArg1, TArg2, TArg3, TArg4, TResult) (
    name As String,
    func As Expression(Of Func(Of TArg1, TArg2, TArg3, TArg4, TResult))
)
public:
generic<typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TResult>
void AddFunction(
    String^ name,
    Expression<Func<TArg1, TArg2, TArg3, TArg4, TResult>^>^ func
)
member AddFunction :
        name : string *
        func : Expression<Func<'TArg1, 'TArg2, 'TArg3, 'TArg4, 'TResult>> -> unit

Parameters

name
Type: SystemString
Function name.
func
Type: System.Linq.ExpressionsExpression Func TArg1, TArg2, TArg3, TArg4, TResult
Function lambda.

Type Parameters

TArg1
First argument.
TArg2
Second argument.
TArg3
Third argument.
TArg4
Fourth argument.
TResult
Type identifier of returned result.
See Also

Reference

Parser Class
AddFunction Overload
ExpressiveAnnotations.Analysis Namespace


Parser.AddFunction(TArg1, TArg2, TArg3, TArg4, TArg5, TResult) Method (String, Expression(Func(TArg1, TArg2, TArg3, TArg4, TArg5, TResult)))

ParserAddFunctionTArg1, TArg2, TArg3, TArg4, TArg5, TResult Method (String, ExpressionFuncTArg1, TArg2, TArg3, TArg4, TArg5, TResult)
Registers function signature for the parser.

Namespace: ExpressiveAnnotations.Analysis
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public void AddFunction<TArg1, TArg2, TArg3, TArg4, TArg5, TResult>(
    string name,
    Expression<Func<TArg1, TArg2, TArg3, TArg4, TArg5, TResult>> func
)

Public Sub AddFunction(Of TArg1, TArg2, TArg3, TArg4, TArg5, TResult) (
    name As String,
    func As Expression(Of Func(Of TArg1, TArg2, TArg3, TArg4, TArg5, TResult))
)
public:
generic<typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TArg5, typename TResult>
void AddFunction(
    String^ name,
    Expression<Func<TArg1, TArg2, TArg3, TArg4, TArg5, TResult>^>^ func
)
member AddFunction :
        name : string *
        func : Expression<Func<'TArg1, 'TArg2, 'TArg3, 'TArg4, 'TArg5, 'TResult>> -> unit

Parameters

name
Type: SystemString
Function name.
func
Type: System.Linq.ExpressionsExpression Func TArg1, TArg2, TArg3, TArg4, TArg5, TResult
Function lambda.

Type Parameters

TArg1
First argument.
TArg2
Second argument.
TArg3
Third argument.
TArg4
Fourth argument.
TArg5
Fifth argument.
TResult
Type identifier of returned result.
See Also

Reference

Parser Class
AddFunction Overload
ExpressiveAnnotations.Analysis Namespace


Parser.AddFunction(TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult) Method (String, Expression(Func(TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult)))

ParserAddFunctionTArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult Method (String, ExpressionFuncTArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult)
Registers function signature for the parser.

Namespace: ExpressiveAnnotations.Analysis
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public void AddFunction<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult>(
    string name,
    Expression<Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult>> func
)

Public Sub AddFunction(Of TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult) (
    name As String,
    func As Expression(Of Func(Of TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult))
)
public:
generic<typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TArg5, typename TArg6, typename TResult>
void AddFunction(
    String^ name,
    Expression<Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult>^>^ func
)
member AddFunction :
        name : string *
        func : Expression<Func<'TArg1, 'TArg2, 'TArg3, 'TArg4, 'TArg5, 'TArg6, 'TResult>> -> unit

Parameters

name
Type: SystemString
Function name.
func
Type: System.Linq.ExpressionsExpression Func TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult
Function lambda.

Type Parameters

TArg1
First argument.
TArg2
Second argument.
TArg3
Third argument.
TArg4
Fourth argument.
TArg5
Fifth argument.
TArg6
Sixth argument.
TResult
Type identifier of returned result.
See Also

Reference

Parser Class
AddFunction Overload
ExpressiveAnnotations.Analysis Namespace


Parser.GetConsts Method

ParserGetConsts Method
Gets names and values of constants extracted from specified expression within given context.

Namespace: ExpressiveAnnotations.Analysis
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public IDictionary<string, Object> GetConsts()
Public Function GetConsts As IDictionary(Of String, Object)
public:
IDictionary<String^, Object^>^ GetConsts()
member GetConsts : unit -> IDictionary<string, Object>

Return Value

Type: IDictionary String, Object
Dictionary containing names and values.
See Also

Reference

Parser Class
ExpressiveAnnotations.Analysis Namespace


Parser.GetFields Method

ParserGetFields Method
Gets names and types of properties extracted from specified expression within given context.

Namespace: ExpressiveAnnotations.Analysis
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public IDictionary<string, Type> GetFields()
Public Function GetFields As IDictionary(Of String, Type)
public:
IDictionary<String^, Type^>^ GetFields()
member GetFields : unit -> IDictionary<string, Type>

Return Value

Type: IDictionary String, Type
Dictionary containing names and types.
See Also

Reference

Parser Class
ExpressiveAnnotations.Analysis Namespace


Parser.Parse Method

ParserParse Method
Overload List
 | Name | Description
Public method | ParseTContext(String) | Parses a specified logical expression into expression tree within given context.
Public method | Parse(Type, String) | Parses a specified logical expression into expression tree within given context.
Top
See Also

Reference

Parser Class
ExpressiveAnnotations.Analysis Namespace


Parser.Parse(TContext) Method (String)

ParserParseTContext Method (String)
Parses a specified logical expression into expression tree within given context.

Namespace: ExpressiveAnnotations.Analysis
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public Func<TContext, bool> Parse<TContext>(
    string expression
)

Public Function Parse(Of TContext) (
    expression As String
) As Func(Of TContext, Boolean)
public:
generic<typename TContext>
Func<TContext, bool>^ Parse(
    String^ expression
)
member Parse :
        expression : string -> Func<'TContext, bool>

Parameters

expression
Type: SystemString
The logical expression.

Type Parameters

TContext
The type identifier of the context within which the expression is interpreted.

Return Value

Type: Func TContext, Boolean
A delegate containing the compiled version of the lambda expression described by created expression tree.
Exceptions
Exception | Condition
InvalidOperationException |
See Also

Reference

Parser Class
Parse Overload
ExpressiveAnnotations.Analysis Namespace


Parser.Parse Method (Type, String)

ParserParse Method (Type, String)
Parses a specified logical expression into expression tree within given context.

Namespace: ExpressiveAnnotations.Analysis
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public Func<Object, bool> Parse(
    Type context,
    string expression
)
Public Function Parse (
    context As Type,
    expression As String
) As Func(Of Object, Boolean)
public:
Func<Object^, bool>^ Parse(
    Type^ context,
    String^ expression
)
member Parse :
        context : Type *
        expression : string -> Func<Object, bool>

Parameters

context
Type: SystemType
The type instance of the context within which the expression is interpreted.
expression
Type: SystemString
The logical expression.

Return Value

Type: Func Object, Boolean
A delegate containing the compiled version of the lambda expression described by created expression tree.
Exceptions
Exception | Condition
InvalidOperationException |
See Also

Reference

Parser Class
Parse Overload
ExpressiveAnnotations.Analysis Namespace


Token Class

Token Class
Token definition.
Inheritance Hierarchy
SystemObject
ExpressiveAnnotations.AnalysisToken

Namespace: ExpressiveAnnotations.Analysis
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public sealed class Token
Public NotInheritable Class Token
public ref class Token sealed
[<SealedAttribute>]
type Token =  class end

The Token type exposes the following members.

Constructors
 | Name | Description
Public method | Token | Initializes a new instance of the Token class.
Top
Properties
 | Name | Description
Public property | Location | Gets or sets the token location within a specified expression.
Public property | Type | Gets the token type.
Public property | Value | Gets the token value.
Top
See Also

Reference

ExpressiveAnnotations.Analysis Namespace


Token Constructor

Token Constructor
Initializes a new instance of the Token class.

Namespace: ExpressiveAnnotations.Analysis
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public Token(
    TokenType type,
    Object value,
    Location location
)
Public Sub New (
    type As TokenType,
    value As Object,
    location As Location
)
public:
Token(
    TokenType type,
    Object^ value,
    Location^ location
)
new :
        type : TokenType *
        value : Object *
        location : Location -> Token

Parameters

type
Type: ExpressiveAnnotations.AnalysisTokenType
The token type.
value
Type: SystemObject
The token value.
location
Type: ExpressiveAnnotations.AnalysisLocation
The token location within a specified expression.
See Also

Reference

Token Class
ExpressiveAnnotations.Analysis Namespace


Token Properties

Token Properties

The Token type exposes the following members.

Properties
 | Name | Description
Public property | Location | Gets or sets the token location within a specified expression.
Public property | Type | Gets the token type.
Public property | Value | Gets the token value.
Top
See Also

Reference

Token Class
ExpressiveAnnotations.Analysis Namespace


Token.Location Property

TokenLocation Property
Gets or sets the token location within a specified expression.

Namespace: ExpressiveAnnotations.Analysis
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public Location Location { get; }
Public ReadOnly Property Location As Location
    Get
public:
property Location^ Location {
    Location^ get ();
}
member Location : Location with get

Property Value

Type: Location
See Also

Reference

Token Class
ExpressiveAnnotations.Analysis Namespace


Token.Type Property

TokenType Property
Gets the token type.

Namespace: ExpressiveAnnotations.Analysis
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public TokenType Type { get; }
Public ReadOnly Property Type As TokenType
    Get
public:
property TokenType Type {
    TokenType get ();
}
member Type : TokenType with get

Property Value

Type: TokenType
See Also

Reference

Token Class
ExpressiveAnnotations.Analysis Namespace


Token.Value Property

TokenValue Property
Gets the token value.

Namespace: ExpressiveAnnotations.Analysis
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public Object Value { get; }
Public ReadOnly Property Value As Object
    Get
public:
property Object^ Value {
    Object^ get ();
}
member Value : Object with get

Property Value

Type: Object
See Also

Reference

Token Class
ExpressiveAnnotations.Analysis Namespace


TokenType Enumeration

TokenType Enumeration
Token type.

Namespace: ExpressiveAnnotations.Analysis
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public enum TokenType
Public Enumeration TokenType
public enum class TokenType
type TokenType
Members
Member name | Value | Description
AND | 0 | Logical conjunction (i.e. &&).
OR | 1 | Logical disjunction (i.e. ||).
NOT | 2 | Logical negation (i.e. !).
GE | 3 | Greater than or equal to (i.e. >=).
LE | 4 | Less than or equal to (i.e. <=).
GT | 5 | Greater than (i.e. >).
LT | 6 | Less than (i.e. <).
EQ | 7 | Equal to (i.e. ==).
NEQ | 8 | Not equal to (i.e. !=).
ADD | 9 | Addition (i.e. +).
SUB | 10 | Subtraction (i.e. -).
MUL | 11 | Multiplication (i.e. *).
DIV | 12 | Division (i.e. /).
INC | 13 | Prefix/postfix inc (i.e. ++).
DEC | 14 | Prefix/postfix dec (i.e. --).
LEFT_BRACKET | 15 | Left bracket (i.e. ().
RIGHT_BRACKET | 16 | Right bracket (i.e. )).
COMMA | 17 | Comma (i.e. ,).
NULL | 18 | NULL (i.e. null).
INT | 19 | Integer value (e.g. 123).
BOOL | 20 | Boolean value (i.e. true, false).
FLOAT | 21 | Float value (e.g. 1.5, -0.3e-2).
STRING | 22 | String (e.g. 'in single quotes').
FUNC | 23 | Function (i.e. SomeProperty, SomeType.CONST, SomeEnumType.SomeValue, SomeArray[0], SomeFunction(...)).
EOF | 24 | End of expression.
See Also

Reference

ExpressiveAnnotations.Analysis Namespace


ExpressiveAnnotations.Attributes Namespace

ExpressiveAnnotations.Attributes Namespace
Namespace provides expressive attributes that are used to define metadata for properties.
Classes
 | Class | Description
Public class | AssertThatAttribute | Validation attribute, executed for non-null annotated field, which indicates that assertion given in logical expression has to be satisfied, for such field to be considered as valid.
Public class | ExpressiveAttribute | Base class for expressive validation attributes.
Public class | RequiredIfAttribute | Validation attribute which indicates that annotated field is required when computed result of given logical expression is true.
Public class | ValueParserAttribute | Provides a hint for client-side script pointing at parser name, which should be used for DOM field value deserialization.


AssertThatAttribute Class

AssertThatAttribute Class
Validation attribute, executed for non-null annotated field, which indicates that assertion given in logical expression has to be satisfied, for such field to be considered as valid.
Inheritance Hierarchy
SystemObject
SystemAttribute
System.ComponentModel.DataAnnotationsValidationAttribute
ExpressiveAnnotations.AttributesExpressiveAttribute
ExpressiveAnnotations.AttributesAssertThatAttribute

Namespace: ExpressiveAnnotations.Attributes
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public sealed class AssertThatAttribute : ExpressiveAttribute
Public NotInheritable Class AssertThatAttribute
    Inherits ExpressiveAttribute
public ref class AssertThatAttribute sealed : public ExpressiveAttribute
[<SealedAttribute>]
type AssertThatAttribute =
    class
        inherit ExpressiveAttribute
    end

The AssertThatAttribute type exposes the following members.

Constructors
 | Name | Description
Public method | AssertThatAttribute | Initializes a new instance of the AssertThatAttribute class.
Top
Properties
 | Name | Description
Public property | Expression | Gets the logical expression based on which specified condition is computed. (Inherited from ExpressiveAttribute.)
Public property | Priority | Gets or sets the hint, available for any concerned external components, indicating the order in which this attribute should be executed among others of its kind, i.e. ExpressiveAttribute. Consumers must use the GetPriority method to retrieve the value, as this property getter will throw an exception if the value has not been set. (Inherited from ExpressiveAttribute.)
Public property | TypeId | When implemented in a derived class, gets a unique identifier for this Attribute. (Inherited from ExpressiveAttribute.)
Top
Methods
 | Name | Description
Public method | Compile | Parses and compiles expression provided to the attribute. Compiled lambda is then cached and used for validation purposes. (Inherited from ExpressiveAttribute.)
Public method | Equals | Determines whether the specified Object, is equal to this instance. (Inherited from ExpressiveAttribute.)
Public method | FormatErrorMessage | Formats the error message. (Inherited from ExpressiveAttribute.)
Public method | GetHashCode | Returns a hash code for this instance. (Inherited from ExpressiveAttribute.)
Public method | GetPriority | Gets the value of Priority if it has been set, or null. (Inherited from ExpressiveAttribute.)
Public method | ToString | Returns a String that represents this instance. (Inherited from ExpressiveAttribute.)
Top
See Also

Reference

ExpressiveAnnotations.Attributes Namespace


AssertThatAttribute Constructor

AssertThatAttribute Constructor
Initializes a new instance of the AssertThatAttribute class.

Namespace: ExpressiveAnnotations.Attributes
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public AssertThatAttribute(
    string expression
)
Public Sub New (
    expression As String
)
public:
AssertThatAttribute(
    String^ expression
)
new :
        expression : string -> AssertThatAttribute

Parameters

expression
Type: SystemString
The logical expression based on which assertion condition is computed.
See Also

Reference

AssertThatAttribute Class
ExpressiveAnnotations.Attributes Namespace


AssertThatAttribute Properties

AssertThatAttribute Properties

The AssertThatAttribute type exposes the following members.

Properties
 | Name | Description
Public property | Expression | Gets the logical expression based on which specified condition is computed. (Inherited from ExpressiveAttribute.)
Public property | Priority | Gets or sets the hint, available for any concerned external components, indicating the order in which this attribute should be executed among others of its kind, i.e. ExpressiveAttribute. Consumers must use the GetPriority method to retrieve the value, as this property getter will throw an exception if the value has not been set. (Inherited from ExpressiveAttribute.)
Public property | TypeId | When implemented in a derived class, gets a unique identifier for this Attribute. (Inherited from ExpressiveAttribute.)
Top
See Also

Reference

AssertThatAttribute Class
ExpressiveAnnotations.Attributes Namespace


AssertThatAttribute Methods

AssertThatAttribute Methods

The AssertThatAttribute type exposes the following members.

Methods
 | Name | Description
Public method | Compile | Parses and compiles expression provided to the attribute. Compiled lambda is then cached and used for validation purposes. (Inherited from ExpressiveAttribute.)
Public method | Equals | Determines whether the specified Object, is equal to this instance. (Inherited from ExpressiveAttribute.)
Public method | FormatErrorMessage | Formats the error message. (Inherited from ExpressiveAttribute.)
Public method | GetHashCode | Returns a hash code for this instance. (Inherited from ExpressiveAttribute.)
Public method | GetPriority | Gets the value of Priority if it has been set, or null. (Inherited from ExpressiveAttribute.)
Public method | ToString | Returns a String that represents this instance. (Inherited from ExpressiveAttribute.)
Top
See Also

Reference

AssertThatAttribute Class
ExpressiveAnnotations.Attributes Namespace


ExpressiveAttribute Class

ExpressiveAttribute Class
Base class for expressive validation attributes.
Inheritance Hierarchy
SystemObject
SystemAttribute
System.ComponentModel.DataAnnotationsValidationAttribute
ExpressiveAnnotations.AttributesExpressiveAttribute
ExpressiveAnnotations.AttributesAssertThatAttribute
ExpressiveAnnotations.AttributesRequiredIfAttribute

Namespace: ExpressiveAnnotations.Attributes
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public abstract class ExpressiveAttribute : ValidationAttribute
Public MustInherit Class ExpressiveAttribute
    Inherits ValidationAttribute
public ref class ExpressiveAttribute abstract : public ValidationAttribute
[<AbstractClassAttribute>]
type ExpressiveAttribute =
    class
        inherit ValidationAttribute
    end

The ExpressiveAttribute type exposes the following members.

Constructors
 | Name | Description
Protected method | ExpressiveAttribute | Constructor for expressive validation attribute.
Top
Properties
 | Name | Description
Protected property | CachedValidationFuncs | Gets the cached validation funcs.
Public property | Expression | Gets the logical expression based on which specified condition is computed.
Protected property | Parser | Gets the parser.
Public property | Priority | Gets or sets the hint, available for any concerned external components, indicating the order in which this attribute should be executed among others of its kind, i.e. ExpressiveAttribute. Consumers must use the GetPriority method to retrieve the value, as this property getter will throw an exception if the value has not been set.
Public property | TypeId | When implemented in a derived class, gets a unique identifier for this Attribute. (Overrides AttributeTypeId.)
Top
Methods
 | Name | Description
Public method | Compile | Parses and compiles expression provided to the attribute. Compiled lambda is then cached and used for validation purposes.
Public method | Equals | Determines whether the specified Object, is equal to this instance. (Overrides AttributeEquals(Object).)
Public method | FormatErrorMessage | Formats the error message.
Public method | GetHashCode | Returns a hash code for this instance. (Overrides AttributeGetHashCode.)
Public method | GetPriority | Gets the value of Priority if it has been set, or null.
Protected method | IsValid | Validates a specified value with respect to the associated validation attribute. (Overrides ValidationAttributeIsValid(Object, ValidationContext).)
Protected method | IsValidInternal | Validates a specified value with respect to the associated validation attribute. Internally used by the IsValid(Object, ValidationContext) method.
Public method | ToString | Returns a String that represents this instance. (Overrides ObjectToString.)
Top
See Also

Reference

ExpressiveAnnotations.Attributes Namespace


ExpressiveAttribute Constructor

ExpressiveAttribute Constructor
Constructor for expressive validation attribute.

Namespace: ExpressiveAnnotations.Attributes
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
protected ExpressiveAttribute(
    string expression,
    string errorMessage
)
Protected Sub New (
    expression As String,
    errorMessage As String
)
protected:
ExpressiveAttribute(
    String^ expression,
    String^ errorMessage
)
new :
        expression : string *
        errorMessage : string -> ExpressiveAttribute

Parameters

expression
Type: SystemString
The logical expression based on which specified condition is computed.
errorMessage
Type: SystemString
The error message to associate with a validation control.
See Also

Reference

ExpressiveAttribute Class
ExpressiveAnnotations.Attributes Namespace


ExpressiveAttribute Properties

ExpressiveAttribute Properties

The ExpressiveAttribute type exposes the following members.

Properties
 | Name | Description
Protected property | CachedValidationFuncs | Gets the cached validation funcs.
Public property | Expression | Gets the logical expression based on which specified condition is computed.
Protected property | Parser | Gets the parser.
Public property | Priority | Gets or sets the hint, available for any concerned external components, indicating the order in which this attribute should be executed among others of its kind, i.e. ExpressiveAttribute. Consumers must use the GetPriority method to retrieve the value, as this property getter will throw an exception if the value has not been set.
Public property | TypeId | When implemented in a derived class, gets a unique identifier for this Attribute. (Overrides AttributeTypeId.)
Top
See Also

Reference

ExpressiveAttribute Class
ExpressiveAnnotations.Attributes Namespace


ExpressiveAttribute.CachedValidationFuncs Property

ExpressiveAttributeCachedValidationFuncs Property
Gets the cached validation funcs.

Namespace: ExpressiveAnnotations.Attributes
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
protected Dictionary<Type, Func<Object, bool>> CachedValidationFuncs { get; }
Protected ReadOnly Property CachedValidationFuncs As Dictionary(Of Type, Func(Of Object, Boolean))
    Get
protected:
property Dictionary<Type^, Func<Object^, bool>^>^ CachedValidationFuncs {
    Dictionary<Type^, Func<Object^, bool>^>^ get ();
}
member CachedValidationFuncs : Dictionary<Type, Func<Object, bool>> with get

Property Value

Type: Dictionary Type, Func Object, Boolean
See Also

Reference

ExpressiveAttribute Class
ExpressiveAnnotations.Attributes Namespace


ExpressiveAttribute.Expression Property

ExpressiveAttributeExpression Property
Gets the logical expression based on which specified condition is computed.

Namespace: ExpressiveAnnotations.Attributes
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public string Expression { get; }
Public ReadOnly Property Expression As String
    Get
public:
property String^ Expression {
    String^ get ();
}
member Expression : string with get

Property Value

Type: String
See Also

Reference

ExpressiveAttribute Class
ExpressiveAnnotations.Attributes Namespace


ExpressiveAttribute.Parser Property

ExpressiveAttributeParser Property
Gets the parser.

Namespace: ExpressiveAnnotations.Attributes
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
protected Parser Parser { get; }
Protected ReadOnly Property Parser As Parser
    Get
protected:
property Parser^ Parser {
    Parser^ get ();
}
member Parser : Parser with get

Property Value

Type: Parser
See Also

Reference

ExpressiveAttribute Class
ExpressiveAnnotations.Attributes Namespace


ExpressiveAttribute.Priority Property

ExpressiveAttributePriority Property
Gets or sets the hint, available for any concerned external components, indicating the order in which this attribute should be executed among others of its kind, i.e. ExpressiveAttribute.

Consumers must use the GetPriority method to retrieve the value, as this property getter will throw an exception if the value has not been set.

Namespace: ExpressiveAnnotations.Attributes
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public int Priority { get; set; }
Public Property Priority As Integer
    Get
    Set
public:
property int Priority {
    int get ();
    void set (int value);
}
member Priority : int with get, set

Property Value

Type: Int32
Exceptions
Exception | Condition
InvalidOperationException | If the getter of this property is invoked when the value has not been explicitly set using the setter.
Remarks
Value is optional and not set by default, which means that execution order is undefined.

Lowest value means highest priority.

See Also

Reference

ExpressiveAttribute Class
ExpressiveAnnotations.Attributes Namespace


ExpressiveAttribute.TypeId Property

ExpressiveAttributeTypeId Property
When implemented in a derived class, gets a unique identifier for this Attribute.

Namespace: ExpressiveAnnotations.Attributes
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public override Object TypeId { get; }
Public Overrides ReadOnly Property TypeId As Object
    Get
public:
virtual property Object^ TypeId {
    Object^ get () override;
}
abstract TypeId : Object with get
override TypeId : Object with get

Property Value

Type: Object
See Also

Reference

ExpressiveAttribute Class
ExpressiveAnnotations.Attributes Namespace


ExpressiveAttribute Methods

ExpressiveAttribute Methods

The ExpressiveAttribute type exposes the following members.

Methods
 | Name | Description
Public method | Compile | Parses and compiles expression provided to the attribute. Compiled lambda is then cached and used for validation purposes.
Public method | Equals | Determines whether the specified Object, is equal to this instance. (Overrides AttributeEquals(Object).)
Public method | FormatErrorMessage | Formats the error message.
Public method | GetHashCode | Returns a hash code for this instance. (Overrides AttributeGetHashCode.)
Public method | GetPriority | Gets the value of Priority if it has been set, or null.
Protected method | IsValid | Validates a specified value with respect to the associated validation attribute. (Overrides ValidationAttributeIsValid(Object, ValidationContext).)
Protected method | IsValidInternal | Validates a specified value with respect to the associated validation attribute. Internally used by the IsValid(Object, ValidationContext) method.
Public method | ToString | Returns a String that represents this instance. (Overrides ObjectToString.)
Top
See Also

Reference

ExpressiveAttribute Class
ExpressiveAnnotations.Attributes Namespace


ExpressiveAttribute.Compile Method

ExpressiveAttributeCompile Method
Parses and compiles expression provided to the attribute. Compiled lambda is then cached and used for validation purposes.

Namespace: ExpressiveAnnotations.Attributes
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public void Compile(
    Type validationContextType,
    bool force = false
)
Public Sub Compile (
    validationContextType As Type,
    Optional force As Boolean = false
)
public:
void Compile(
    Type^ validationContextType,
    bool force = false
)
member Compile :
        validationContextType : Type *
        ?force : bool
(* Defaults:
        let _force = defaultArg force false
*)
-> unit

Parameters

validationContextType
Type: SystemType
The type of the object to be validated.
force (Optional)
Type: SystemBoolean
Flag indicating whether parsing should be rerun despite the fact compiled lambda already exists.
See Also

Reference

ExpressiveAttribute Class
ExpressiveAnnotations.Attributes Namespace


ExpressiveAttribute.Equals Method

ExpressiveAttributeEquals Method
Determines whether the specified Object, is equal to this instance.

Namespace: ExpressiveAnnotations.Attributes
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public override bool Equals(
    Object obj
)
Public Overrides Function Equals (
    obj As Object
) As Boolean
public:
virtual bool Equals(
    Object^ obj
) override
abstract Equals :
        obj : Object -> bool
override Equals :
        obj : Object -> bool

Parameters

obj
Type: SystemObject
The Object to compare with this instance.

Return Value

Type: Boolean
true if the specified Object is equal to this instance; otherwise, false.
See Also

Reference

ExpressiveAttribute Class
ExpressiveAnnotations.Attributes Namespace


ExpressiveAttribute.FormatErrorMessage Method

ExpressiveAttributeFormatErrorMessage Method
Formats the error message.

Namespace: ExpressiveAnnotations.Attributes
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public string FormatErrorMessage(
    string displayName,
    string expression
)
Public Function FormatErrorMessage (
    displayName As String,
    expression As String
) As String
public:
String^ FormatErrorMessage(
    String^ displayName,
    String^ expression
)
member FormatErrorMessage :
        displayName : string *
        expression : string -> string

Parameters

displayName
Type: SystemString
The user-visible name of the required field to include in the formatted message.
expression
Type: SystemString
The user-visible expression to include in the formatted message.

Return Value

Type: String
The localized message to present to the user.
Remarks
This method interprets custom format specifiers, provided to error message string, for which model fields values will be extracted. Specifiers should be given in braces (curly brackets), e.g. {field}, {field.field}. Braces can be escaped by double-braces, i.e. to output a { use {{ and to output a } use }}.
See Also

Reference

ExpressiveAttribute Class
ExpressiveAnnotations.Attributes Namespace


ExpressiveAttribute.GetHashCode Method

ExpressiveAttributeGetHashCode Method
Returns a hash code for this instance.

Namespace: ExpressiveAnnotations.Attributes
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public override int GetHashCode()
Public Overrides Function GetHashCode As Integer
public:
virtual int GetHashCode() override
abstract GetHashCode : unit -> int
override GetHashCode : unit -> int

Return Value

Type: Int32
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
See Also

Reference

ExpressiveAttribute Class
ExpressiveAnnotations.Attributes Namespace


ExpressiveAttribute.GetPriority Method

ExpressiveAttributeGetPriority Method
Gets the value of Priority if it has been set, or null.

Namespace: ExpressiveAnnotations.Attributes
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public Nullable<int> GetPriority()
Public Function GetPriority As Nullable(Of Integer)
public:
Nullable<int> GetPriority()
member GetPriority : unit -> Nullable<int>

Return Value

Type: Nullable Int32
When Priority has been set returns the value of that property.

When Priority has not been set returns null.

See Also

Reference

ExpressiveAttribute Class
ExpressiveAnnotations.Attributes Namespace


ExpressiveAttribute.IsValid Method

ExpressiveAttributeIsValid Method
Validates a specified value with respect to the associated validation attribute.

Namespace: ExpressiveAnnotations.Attributes
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
protected override ValidationResult IsValid(
    Object value,
    ValidationContext validationContext
)
Protected Overrides Function IsValid (
    value As Object,
    validationContext As ValidationContext
) As ValidationResult
protected:
virtual ValidationResult^ IsValid(
    Object^ value,
    ValidationContext^ validationContext
) override
abstract IsValid :
        value : Object *
        validationContext : ValidationContext -> ValidationResult
override IsValid :
        value : Object *
        validationContext : ValidationContext -> ValidationResult

Parameters

value
Type: SystemObject
The value to validate.
validationContext
Type: System.ComponentModel.DataAnnotationsValidationContext
The validation context.

Return Value

Type: ValidationResult
An instance of the ValidationResult class.
Exceptions
Exception | Condition
ArgumentNullException | validationContext;ValidationContext not provided.
ValidationException |
See Also

Reference

ExpressiveAttribute Class
ExpressiveAnnotations.Attributes Namespace


ExpressiveAttribute.IsValidInternal Method

ExpressiveAttributeIsValidInternal Method
Validates a specified value with respect to the associated validation attribute. Internally used by the IsValid(Object, ValidationContext) method.

Namespace: ExpressiveAnnotations.Attributes
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
protected abstract ValidationResult IsValidInternal(
    Object value,
    ValidationContext validationContext
)
Protected MustOverride Function IsValidInternal (
    value As Object,
    validationContext As ValidationContext
) As ValidationResult
protected:
virtual ValidationResult^ IsValidInternal(
    Object^ value,
    ValidationContext^ validationContext
) abstract
abstract IsValidInternal :
        value : Object *
        validationContext : ValidationContext -> ValidationResult

Parameters

value
Type: SystemObject
The value to validate.
validationContext
Type: System.ComponentModel.DataAnnotationsValidationContext
The validation context.

Return Value

Type: ValidationResult
An instance of the ValidationResult class.
See Also

Reference

ExpressiveAttribute Class
ExpressiveAnnotations.Attributes Namespace


ExpressiveAttribute.ToString Method

ExpressiveAttributeToString Method
Returns a String that represents this instance.

Namespace: ExpressiveAnnotations.Attributes
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public override string ToString()
Public Overrides Function ToString As String
public:
virtual String^ ToString() override
abstract ToString : unit -> string
override ToString : unit -> string

Return Value

Type: String
A String that represents this instance.
See Also

Reference

ExpressiveAttribute Class
ExpressiveAnnotations.Attributes Namespace


RequiredIfAttribute Class

RequiredIfAttribute Class
Validation attribute which indicates that annotated field is required when computed result of given logical expression is true.
Inheritance Hierarchy
SystemObject
SystemAttribute
System.ComponentModel.DataAnnotationsValidationAttribute
ExpressiveAnnotations.AttributesExpressiveAttribute
ExpressiveAnnotations.AttributesRequiredIfAttribute

Namespace: ExpressiveAnnotations.Attributes
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public sealed class RequiredIfAttribute : ExpressiveAttribute
Public NotInheritable Class RequiredIfAttribute
    Inherits ExpressiveAttribute
public ref class RequiredIfAttribute sealed : public ExpressiveAttribute
[<SealedAttribute>]
type RequiredIfAttribute =
    class
        inherit ExpressiveAttribute
    end

The RequiredIfAttribute type exposes the following members.

Constructors
 | Name | Description
Public method | RequiredIfAttribute | Initializes a new instance of the RequiredIfAttribute class.
Top
Properties
 | Name | Description
Public property | AllowEmptyStrings | Gets or sets a flag indicating whether the attribute should allow empty or whitespace strings.
Public property | Expression | Gets the logical expression based on which specified condition is computed. (Inherited from ExpressiveAttribute.)
Public property | Priority | Gets or sets the hint, available for any concerned external components, indicating the order in which this attribute should be executed among others of its kind, i.e. ExpressiveAttribute. Consumers must use the GetPriority method to retrieve the value, as this property getter will throw an exception if the value has not been set. (Inherited from ExpressiveAttribute.)
Public property | TypeId | When implemented in a derived class, gets a unique identifier for this Attribute. (Inherited from ExpressiveAttribute.)
Top
Methods
 | Name | Description
Public method | Compile | Parses and compiles expression provided to the attribute. Compiled lambda is then cached and used for validation purposes. (Inherited from ExpressiveAttribute.)
Public method | Equals | Determines whether the specified Object, is equal to this instance. (Inherited from ExpressiveAttribute.)
Public method | FormatErrorMessage | Formats the error message. (Inherited from ExpressiveAttribute.)
Public method | GetHashCode | Returns a hash code for this instance. (Inherited from ExpressiveAttribute.)
Public method | GetPriority | Gets the value of Priority if it has been set, or null. (Inherited from ExpressiveAttribute.)
Public method | ToString | Returns a String that represents this instance. (Inherited from ExpressiveAttribute.)
Top
See Also

Reference

ExpressiveAnnotations.Attributes Namespace


RequiredIfAttribute Constructor

RequiredIfAttribute Constructor
Initializes a new instance of the RequiredIfAttribute class.

Namespace: ExpressiveAnnotations.Attributes
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public RequiredIfAttribute(
    string expression
)
Public Sub New (
    expression As String
)
public:
RequiredIfAttribute(
    String^ expression
)
new :
        expression : string -> RequiredIfAttribute

Parameters

expression
Type: SystemString
The logical expression based on which requirement condition is computed.
See Also

Reference

RequiredIfAttribute Class
ExpressiveAnnotations.Attributes Namespace


RequiredIfAttribute Properties

RequiredIfAttribute Properties

The RequiredIfAttribute type exposes the following members.

Properties
 | Name | Description
Public property | AllowEmptyStrings | Gets or sets a flag indicating whether the attribute should allow empty or whitespace strings.
Public property | Expression | Gets the logical expression based on which specified condition is computed. (Inherited from ExpressiveAttribute.)
Public property | Priority | Gets or sets the hint, available for any concerned external components, indicating the order in which this attribute should be executed among others of its kind, i.e. ExpressiveAttribute. Consumers must use the GetPriority method to retrieve the value, as this property getter will throw an exception if the value has not been set. (Inherited from ExpressiveAttribute.)
Public property | TypeId | When implemented in a derived class, gets a unique identifier for this Attribute. (Inherited from ExpressiveAttribute.)
Top
See Also

Reference

RequiredIfAttribute Class
ExpressiveAnnotations.Attributes Namespace


RequiredIfAttribute.AllowEmptyStrings Property

RequiredIfAttributeAllowEmptyStrings Property
Gets or sets a flag indicating whether the attribute should allow empty or whitespace strings.

Namespace: ExpressiveAnnotations.Attributes
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public bool AllowEmptyStrings { get; set; }
Public Property AllowEmptyStrings As Boolean
    Get
    Set
public:
property bool AllowEmptyStrings {
    bool get ();
    void set (bool value);
}
member AllowEmptyStrings : bool with get, set

Property Value

Type: Boolean
Remarks
false by default.
See Also

Reference

RequiredIfAttribute Class
ExpressiveAnnotations.Attributes Namespace


RequiredIfAttribute Methods

RequiredIfAttribute Methods

The RequiredIfAttribute type exposes the following members.

Methods
 | Name | Description
Public method | Compile | Parses and compiles expression provided to the attribute. Compiled lambda is then cached and used for validation purposes. (Inherited from ExpressiveAttribute.)
Public method | Equals | Determines whether the specified Object, is equal to this instance. (Inherited from ExpressiveAttribute.)
Public method | FormatErrorMessage | Formats the error message. (Inherited from ExpressiveAttribute.)
Public method | GetHashCode | Returns a hash code for this instance. (Inherited from ExpressiveAttribute.)
Public method | GetPriority | Gets the value of Priority if it has been set, or null. (Inherited from ExpressiveAttribute.)
Public method | ToString | Returns a String that represents this instance. (Inherited from ExpressiveAttribute.)
Top
See Also

Reference

RequiredIfAttribute Class
ExpressiveAnnotations.Attributes Namespace


ValueParserAttribute Class

ValueParserAttribute Class
Provides a hint for client-side script pointing at parser name, which should be used for DOM field value deserialization.
Inheritance Hierarchy
SystemObject
SystemAttribute
ExpressiveAnnotations.AttributesValueParserAttribute

Namespace: ExpressiveAnnotations.Attributes
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public sealed class ValueParserAttribute : Attribute
Public NotInheritable Class ValueParserAttribute
    Inherits Attribute
public ref class ValueParserAttribute sealed : public Attribute
[<SealedAttribute>]
type ValueParserAttribute =
    class
        inherit Attribute
    end

The ValueParserAttribute type exposes the following members.

Constructors
 | Name | Description
Public method | ValueParserAttribute | Initializes a new instance of the ValueParserAttribute class.
Top
Properties
 | Name | Description
Public property | ParserName | Gets the name of the parser.
Top
See Also

Reference

ExpressiveAnnotations.Attributes Namespace


ValueParserAttribute Constructor

ValueParserAttribute Constructor
Initializes a new instance of the ValueParserAttribute class.

Namespace: ExpressiveAnnotations.Attributes
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public ValueParserAttribute(
    string parserName
)
Public Sub New (
    parserName As String
)
public:
ValueParserAttribute(
    String^ parserName
)
new :
        parserName : string -> ValueParserAttribute

Parameters

parserName
Type: SystemString
Name of the parser.
See Also

Reference

ValueParserAttribute Class
ExpressiveAnnotations.Attributes Namespace


ValueParserAttribute Properties

ValueParserAttribute Properties

The ValueParserAttribute type exposes the following members.

Properties
 | Name | Description
Public property | ParserName | Gets the name of the parser.
Top
See Also

Reference

ValueParserAttribute Class
ExpressiveAnnotations.Attributes Namespace


ValueParserAttribute.ParserName Property

ValueParserAttributeParserName Property
Gets the name of the parser.

Namespace: ExpressiveAnnotations.Attributes
Assembly: ExpressiveAnnotations (in ExpressiveAnnotations.dll) Version: 2.3.3.0 (2.3.3.0)
Syntax
C#
VB
C++
F#
Copy
public string ParserName { get; }
Public ReadOnly Property ParserName As String
    Get
public:
property String^ ParserName {
    String^ get ();
}
member ParserName : string with get

Property Value

Type: String
See Also

Reference

ValueParserAttribute Class
ExpressiveAnnotations.Attributes Namespace


ExpressiveAnnotations.MvcUnobtrusive.Providers Namespace

ExpressiveAnnotations.MvcUnobtrusive.Providers Namespace
Namespace provides validator providers.
Classes
 | Class | Description
Public class | ExpressiveAnnotationsModelValidatorProvider | Data annotations validator provider which automatically registers adapters for expressive validation attributes, i.e. ExpressiveAttribute, and additionally respects their processing priorities (if Priority is specified) when validation is executed.


ExpressiveAnnotationsModelValidatorProvider Class

ExpressiveAnnotationsModelValidatorProvider Class
Data annotations validator provider which automatically registers adapters for expressive validation attributes, i.e. ExpressiveAttribute, and additionally respects their processing priorities (if Priority is specified) when validation is executed.
Inheritance Hierarchy
SystemObject
ModelValidatorProvider
AssociatedValidatorProvider
DataAnnotationsModelValidatorProvider
ExpressiveAnnotations.MvcUnobtrusive.ProvidersExpressiveAnnotationsModelValidatorProvider

Namespace: ExpressiveAnnotations.MvcUnobtrusive.Providers
Assembly: ExpressiveAnnotations.MvcUnobtrusive (in ExpressiveAnnotations.MvcUnobtrusive.dll) Version: 2.4.2.0 (2.4.2.0)
Syntax
C#
VB
C++
F#
Copy
public class ExpressiveAnnotationsModelValidatorProvider : DataAnnotationsModelValidatorProvider
Public Class ExpressiveAnnotationsModelValidatorProvider
    Inherits DataAnnotationsModelValidatorProvider
public ref class ExpressiveAnnotationsModelValidatorProvider : public DataAnnotationsModelValidatorProvider
type ExpressiveAnnotationsModelValidatorProvider =
    class
        inherit DataAnnotationsModelValidatorProvider
    end

The ExpressiveAnnotationsModelValidatorProvider type exposes the following members.

Constructors
 | Name | Description
Public method | ExpressiveAnnotationsModelValidatorProvider | Initializes a new instance of the ExpressiveAnnotationsModelValidatorProvider class.
Top
Methods
 | Name | Description
Protected method | GetValidators | Gets a list of validators. (Overrides DataAnnotationsModelValidatorProvider.GetValidators(ModelMetadata, ControllerContext, IEnumerableAttribute).)
Top
Remarks
Attributes with highest priority (lowest value) will be processed in first place. Attributes without explicitly proivided priorities will be processed later, without any specific order.
See Also

Reference

ExpressiveAnnotations.MvcUnobtrusive.Providers Namespace


ExpressiveAnnotationsModelValidatorProvider Constructor

ExpressiveAnnotationsModelValidatorProvider Constructor
Initializes a new instance of the ExpressiveAnnotationsModelValidatorProvider class.

Namespace: ExpressiveAnnotations.MvcUnobtrusive.Providers
Assembly: ExpressiveAnnotations.MvcUnobtrusive (in ExpressiveAnnotations.MvcUnobtrusive.dll) Version: 2.4.2.0 (2.4.2.0)
Syntax
C#
VB
C++
F#
Copy
public ExpressiveAnnotationsModelValidatorProvider()
Public Sub New
public:
ExpressiveAnnotationsModelValidatorProvider()
new : unit -> ExpressiveAnnotationsModelValidatorProvider
See Also

Reference

ExpressiveAnnotationsModelValidatorProvider Class
ExpressiveAnnotations.MvcUnobtrusive.Providers Namespace


ExpressiveAnnotationsModelValidatorProvider Methods

ExpressiveAnnotationsModelValidatorProvider Methods

The ExpressiveAnnotationsModelValidatorProvider type exposes the following members.

Methods
 | Name | Description
Protected method | GetValidators | Gets a list of validators. (Overrides DataAnnotationsModelValidatorProvider.GetValidators(ModelMetadata, ControllerContext, IEnumerableAttribute).)
Top
See Also

Reference

ExpressiveAnnotationsModelValidatorProvider Class
ExpressiveAnnotations.MvcUnobtrusive.Providers Namespace


ExpressiveAnnotationsModelValidatorProvider.GetValidators Method

ExpressiveAnnotationsModelValidatorProviderGetValidators Method
Gets a list of validators.

Namespace: ExpressiveAnnotations.MvcUnobtrusive.Providers
Assembly: ExpressiveAnnotations.MvcUnobtrusive (in ExpressiveAnnotations.MvcUnobtrusive.dll) Version: 2.4.2.0 (2.4.2.0)
Syntax
C#
VB
C++
F#
Copy
protected override IEnumerable<ModelValidator> GetValidators(
    ModelMetadata metadata,
    ControllerContext context,
    IEnumerable<Attribute> attributes
)
Protected Overrides Function GetValidators (
    metadata As ModelMetadata,
    context As ControllerContext,
    attributes As IEnumerable(Of Attribute)
) As IEnumerable(Of ModelValidator)
protected:
virtual IEnumerable<ModelValidator^>^ GetValidators(
    ModelMetadata^ metadata,
    ControllerContext^ context,
    IEnumerable<Attribute^>^ attributes
) override
abstract GetValidators :
        metadata : ModelMetadata *
        context : ControllerContext *
        attributes : IEnumerable<Attribute> -> IEnumerable<ModelValidator>
override GetValidators :
        metadata : ModelMetadata *
        context : ControllerContext *
        attributes : IEnumerable<Attribute> -> IEnumerable<ModelValidator>

Parameters

metadata
Type: ModelMetadata
The metadata.
context
Type: ControllerContext
The context.
attributes
Type: System.Collections.GenericIEnumerable Attribute
The list of validation attributes.

Return Value

Type: IEnumerable ModelValidator
A list of validators.
See Also

Reference

ExpressiveAnnotationsModelValidatorProvider Class
ExpressiveAnnotations.MvcUnobtrusive.Providers Namespace


ExpressiveAnnotations.MvcUnobtrusive.Validators Namespace

ExpressiveAnnotations.MvcUnobtrusive.Validators Namespace
Namespace provides expressive validators for a specified validation types.
Classes
 | Class | Description
Public class | AssertThatValidator | Model validator for AssertThatAttribute.
Public class | ExpressiveValidatorT | Base class for expressive validators.
Public class | RequiredIfValidator | Model validator for RequiredIfAttribute.


AssertThatValidator Class

AssertThatValidator Class
Model validator for AssertThatAttribute.
Inheritance Hierarchy
SystemObject
ModelValidator
DataAnnotationsModelValidator
DataAnnotationsModelValidator AssertThatAttribute
ExpressiveAnnotations.MvcUnobtrusive.ValidatorsExpressiveValidator AssertThatAttribute
ExpressiveAnnotations.MvcUnobtrusive.ValidatorsAssertThatValidator

Namespace: ExpressiveAnnotations.MvcUnobtrusive.Validators
Assembly: ExpressiveAnnotations.MvcUnobtrusive (in ExpressiveAnnotations.MvcUnobtrusive.dll) Version: 2.4.2.0 (2.4.2.0)
Syntax
C#
VB
C++
F#
Copy
public class AssertThatValidator : ExpressiveValidator<AssertThatAttribute>
Public Class AssertThatValidator
    Inherits ExpressiveValidator(Of AssertThatAttribute)
public ref class AssertThatValidator : public ExpressiveValidator<AssertThatAttribute^>
type AssertThatValidator =
    class
        inherit ExpressiveValidator<AssertThatAttribute>
    end

The AssertThatValidator type exposes the following members.

Constructors
 | Name | Description
Public method | AssertThatValidator | Initializes a new instance of the AssertThatValidator class.
Top
Properties
 | Name | Description
Protected property | ConstsMap | Gets names and values of constants extracted from specified expression within given context. (Inherited from ExpressiveValidatorT.)
Protected property | Expression | Gets the expression. (Inherited from ExpressiveValidatorT.)
Protected property | FieldsMap | Gets names and coarse types of properties extracted from specified expression within given context. (Inherited from ExpressiveValidatorT.)
Protected property | FormattedErrorMessage | Gets the formatted error message. (Inherited from ExpressiveValidatorT.)
Protected property | ParsersMap | Gets properties names and parsers registered for them via ValueParserAttribute. (Inherited from ExpressiveValidatorT.)
Top
Methods
 | Name | Description
Protected method | GetBasicRule | Generates client validation rule with the basic set of parameters. (Inherited from ExpressiveValidatorT.)
Public method | GetClientValidationRules | Retrieves a collection of client validation rules (which are next sent to browsers). (Overrides DataAnnotationsModelValidator.GetClientValidationRules.)
Top
See Also

Reference

ExpressiveAnnotations.MvcUnobtrusive.Validators Namespace


AssertThatValidator Constructor

AssertThatValidator Constructor
Initializes a new instance of the AssertThatValidator class.

Namespace: ExpressiveAnnotations.MvcUnobtrusive.Validators
Assembly: ExpressiveAnnotations.MvcUnobtrusive (in ExpressiveAnnotations.MvcUnobtrusive.dll) Version: 2.4.2.0 (2.4.2.0)
Syntax
C#
VB
C++
F#
Copy
public AssertThatValidator(
    ModelMetadata metadata,
    ControllerContext context,
    AssertThatAttribute attribute
)
Public Sub New (
    metadata As ModelMetadata,
    context As ControllerContext,
    attribute As AssertThatAttribute
)
public:
AssertThatValidator(
    ModelMetadata^ metadata,
    ControllerContext^ context,
    AssertThatAttribute^ attribute
)
new :
        metadata : ModelMetadata *
        context : ControllerContext *
        attribute : AssertThatAttribute -> AssertThatValidator

Parameters

metadata
Type: ModelMetadata
The model metadata instance.
context
Type: ControllerContext
The controller context instance.
attribute
Type: ExpressiveAnnotations.AttributesAssertThatAttribute
The expressive assertion attribute instance.
Exceptions
Exception | Condition
ValidationException |
See Also

Reference

AssertThatValidator Class
ExpressiveAnnotations.MvcUnobtrusive.Validators Namespace


AssertThatValidator Properties

AssertThatValidator Properties

The AssertThatValidator type exposes the following members.

Properties
 | Name | Description
Protected property | ConstsMap | Gets names and values of constants extracted from specified expression within given context. (Inherited from ExpressiveValidatorT.)
Protected property | Expression | Gets the expression. (Inherited from ExpressiveValidatorT.)
Protected property | FieldsMap | Gets names and coarse types of properties extracted from specified expression within given context. (Inherited from ExpressiveValidatorT.)
Protected property | FormattedErrorMessage | Gets the formatted error message. (Inherited from ExpressiveValidatorT.)
Protected property | ParsersMap | Gets properties names and parsers registered for them via ValueParserAttribute. (Inherited from ExpressiveValidatorT.)
Top
See Also

Reference

AssertThatValidator Class
ExpressiveAnnotations.MvcUnobtrusive.Validators Namespace


AssertThatValidator Methods

AssertThatValidator Methods

The AssertThatValidator type exposes the following members.

Methods
 | Name | Description
Protected method | GetBasicRule | Generates client validation rule with the basic set of parameters. (Inherited from ExpressiveValidatorT.)
Public method | GetClientValidationRules | Retrieves a collection of client validation rules (which are next sent to browsers). (Overrides DataAnnotationsModelValidator.GetClientValidationRules.)
Top
See Also

Reference

AssertThatValidator Class
ExpressiveAnnotations.MvcUnobtrusive.Validators Namespace


AssertThatValidator.GetClientValidationRules Method

AssertThatValidatorGetClientValidationRules Method
Retrieves a collection of client validation rules (which are next sent to browsers).

Namespace: ExpressiveAnnotations.MvcUnobtrusive.Validators
Assembly: ExpressiveAnnotations.MvcUnobtrusive (in ExpressiveAnnotations.MvcUnobtrusive.dll) Version: 2.4.2.0 (2.4.2.0)
Syntax
C#
VB
C++
F#
Copy
public override IEnumerable<ModelClientValidationRule> GetClientValidationRules()
Public Overrides Function GetClientValidationRules As IEnumerable(Of ModelClientValidationRule)
public:
virtual IEnumerable<ModelClientValidationRule^>^ GetClientValidationRules() override
abstract GetClientValidationRules : unit -> IEnumerable<ModelClientValidationRule>
override GetClientValidationRules : unit -> IEnumerable<ModelClientValidationRule>

Return Value

Type: IEnumerable ModelClientValidationRule
A collection of client validation rules.
See Also

Reference

AssertThatValidator Class
ExpressiveAnnotations.MvcUnobtrusive.Validators Namespace


ExpressiveValidator(T) Class

ExpressiveValidatorT Class
Base class for expressive validators.
Inheritance Hierarchy
SystemObject
ModelValidator
DataAnnotationsModelValidator
DataAnnotationsModelValidator T
ExpressiveAnnotations.MvcUnobtrusive.ValidatorsExpressiveValidatorT
ExpressiveAnnotations.MvcUnobtrusive.ValidatorsAssertThatValidator
ExpressiveAnnotations.MvcUnobtrusive.ValidatorsRequiredIfValidator

Namespace: ExpressiveAnnotations.MvcUnobtrusive.Validators
Assembly: ExpressiveAnnotations.MvcUnobtrusive (in ExpressiveAnnotations.MvcUnobtrusive.dll) Version: 2.4.2.0 (2.4.2.0)
Syntax
C#
VB
C++
F#
Copy
public abstract class ExpressiveValidator<T> : DataAnnotationsModelValidator<T>
where T : ExpressiveAttribute

Public MustInherit Class ExpressiveValidator(Of T As ExpressiveAttribute)
    Inherits DataAnnotationsModelValidator(Of T)
generic<typename T>
where T : ExpressiveAttribute
public ref class ExpressiveValidator abstract : public DataAnnotationsModelValidator<T>
[<AbstractClassAttribute>]
type ExpressiveValidator<'T when 'T : ExpressiveAttribute> =
    class
        inherit DataAnnotationsModelValidator<'T>
    end

Type Parameters

T
Any type derived from ExpressiveAttribute class.

The ExpressiveValidatorT type exposes the following members.

Constructors
 | Name | Description
Protected method | ExpressiveValidatorT | Constructor for expressive model validator.
Top
Properties
 | Name | Description
Protected property | ConstsMap | Gets names and values of constants extracted from specified expression within given context.
Protected property | Expression | Gets the expression.
Protected property | FieldsMap | Gets names and coarse types of properties extracted from specified expression within given context.
Protected property | FormattedErrorMessage | Gets the formatted error message.
Protected property | ParsersMap | Gets properties names and parsers registered for them via ValueParserAttribute.
Top
Methods
 | Name | Description
Protected method | GetBasicRule | Generates client validation rule with the basic set of parameters.
Top
See Also

Reference

ExpressiveAnnotations.MvcUnobtrusive.Validators Namespace


ExpressiveValidator(T) Constructor

ExpressiveValidatorT Constructor
Constructor for expressive model validator.

Namespace: ExpressiveAnnotations.MvcUnobtrusive.Validators
Assembly: ExpressiveAnnotations.MvcUnobtrusive (in ExpressiveAnnotations.MvcUnobtrusive.dll) Version: 2.4.2.0 (2.4.2.0)
Syntax
C#
VB
C++
F#
Copy
protected ExpressiveValidator(
    ModelMetadata metadata,
    ControllerContext context,
    T attribute
)
Protected Sub New (
    metadata As ModelMetadata,
    context As ControllerContext,
    attribute As T
)
protected:
ExpressiveValidator(
    ModelMetadata^ metadata,
    ControllerContext^ context,
    T attribute
)
new :
        metadata : ModelMetadata *
        context : ControllerContext *
        attribute : 'T -> ExpressiveValidator

Parameters

metadata
Type: ModelMetadata
The model metadata instance.
context
Type: ControllerContext
The controller context instance.
attribute
Type: T
The expressive attribute instance.
Exceptions
Exception | Condition
ValidationException |
See Also

Reference

ExpressiveValidatorT Class
ExpressiveAnnotations.MvcUnobtrusive.Validators Namespace


ExpressiveValidator(T) Properties

ExpressiveValidatorT Properties

The ExpressiveValidatorT generic type exposes the following members.

Properties
 | Name | Description
Protected property | ConstsMap | Gets names and values of constants extracted from specified expression within given context.
Protected property | Expression | Gets the expression.
Protected property | FieldsMap | Gets names and coarse types of properties extracted from specified expression within given context.
Protected property | FormattedErrorMessage | Gets the formatted error message.
Protected property | ParsersMap | Gets properties names and parsers registered for them via ValueParserAttribute.
Top
See Also

Reference

ExpressiveValidatorT Class
ExpressiveAnnotations.MvcUnobtrusive.Validators Namespace


ExpressiveValidator(T).ConstsMap Property

ExpressiveValidatorTConstsMap Property
Gets names and values of constants extracted from specified expression within given context.

Namespace: ExpressiveAnnotations.MvcUnobtrusive.Validators
Assembly: ExpressiveAnnotations.MvcUnobtrusive (in ExpressiveAnnotations.MvcUnobtrusive.dll) Version: 2.4.2.0 (2.4.2.0)
Syntax
C#
VB
C++
F#
Copy
protected IDictionary<string, Object> ConstsMap { get; }
Protected ReadOnly Property ConstsMap As IDictionary(Of String, Object)
    Get
protected:
property IDictionary<String^, Object^>^ ConstsMap {
    IDictionary<String^, Object^>^ get ();
}
member ConstsMap : IDictionary<string, Object> with get

Property Value

Type: IDictionary String, Object
See Also

Reference

ExpressiveValidatorT Class
ExpressiveAnnotations.MvcUnobtrusive.Validators Namespace


ExpressiveValidator(T).Expression Property

ExpressiveValidatorTExpression Property
Gets the expression.

Namespace: ExpressiveAnnotations.MvcUnobtrusive.Validators
Assembly: ExpressiveAnnotations.MvcUnobtrusive (in ExpressiveAnnotations.MvcUnobtrusive.dll) Version: 2.4.2.0 (2.4.2.0)
Syntax
C#
VB
C++
F#
Copy
protected string Expression { get; }
Protected ReadOnly Property Expression As String
    Get
protected:
property String^ Expression {
    String^ get ();
}
member Expression : string with get

Property Value

Type: String
See Also

Reference

ExpressiveValidatorT Class
ExpressiveAnnotations.MvcUnobtrusive.Validators Namespace


ExpressiveValidator(T).FieldsMap Property

ExpressiveValidatorTFieldsMap Property
Gets names and coarse types of properties extracted from specified expression within given context.

Namespace: ExpressiveAnnotations.MvcUnobtrusive.Validators
Assembly: ExpressiveAnnotations.MvcUnobtrusive (in ExpressiveAnnotations.MvcUnobtrusive.dll) Version: 2.4.2.0 (2.4.2.0)
Syntax
C#
VB
C++
F#
Copy
protected IDictionary<string, string> FieldsMap { get; }
Protected ReadOnly Property FieldsMap As IDictionary(Of String, String)
    Get
protected:
property IDictionary<String^, String^>^ FieldsMap {
    IDictionary<String^, String^>^ get ();
}
member FieldsMap : IDictionary<string, string> with get

Property Value

Type: IDictionary String, String
See Also

Reference

ExpressiveValidatorT Class
ExpressiveAnnotations.MvcUnobtrusive.Validators Namespace


ExpressiveValidator(T).FormattedErrorMessage Property

ExpressiveValidatorTFormattedErrorMessage Property
Gets the formatted error message.

Namespace: ExpressiveAnnotations.MvcUnobtrusive.Validators
Assembly: ExpressiveAnnotations.MvcUnobtrusive (in ExpressiveAnnotations.MvcUnobtrusive.dll) Version: 2.4.2.0 (2.4.2.0)
Syntax
C#
VB
C++
F#
Copy
protected string FormattedErrorMessage { get; }
Protected ReadOnly Property FormattedErrorMessage As String
    Get
protected:
property String^ FormattedErrorMessage {
    String^ get ();
}
member FormattedErrorMessage : string with get

Property Value

Type: String
See Also

Reference

ExpressiveValidatorT Class
ExpressiveAnnotations.MvcUnobtrusive.Validators Namespace


ExpressiveValidator(T).ParsersMap Property

ExpressiveValidatorTParsersMap Property
Gets properties names and parsers registered for them via ValueParserAttribute.

Namespace: ExpressiveAnnotations.MvcUnobtrusive.Validators
Assembly: ExpressiveAnnotations.MvcUnobtrusive (in ExpressiveAnnotations.MvcUnobtrusive.dll) Version: 2.4.2.0 (2.4.2.0)
Syntax
C#
VB
C++
F#
Copy
protected IDictionary<string, string> ParsersMap { get; }
Protected ReadOnly Property ParsersMap As IDictionary(Of String, String)
    Get
protected:
property IDictionary<String^, String^>^ ParsersMap {
    IDictionary<String^, String^>^ get ();
}
member ParsersMap : IDictionary<string, string> with get

Property Value

Type: IDictionary String, String
See Also

Reference

ExpressiveValidatorT Class
ExpressiveAnnotations.MvcUnobtrusive.Validators Namespace


ExpressiveValidator(T) Methods

ExpressiveValidatorT Methods

The ExpressiveValidatorT generic type exposes the following members.

Methods
 | Name | Description
Protected method | GetBasicRule | Generates client validation rule with the basic set of parameters.
Top
See Also

Reference

ExpressiveValidatorT Class
ExpressiveAnnotations.MvcUnobtrusive.Validators Namespace


ExpressiveValidator(T).GetBasicRule Method

ExpressiveValidatorTGetBasicRule Method
Generates client validation rule with the basic set of parameters.

Namespace: ExpressiveAnnotations.MvcUnobtrusive.Validators
Assembly: ExpressiveAnnotations.MvcUnobtrusive (in ExpressiveAnnotations.MvcUnobtrusive.dll) Version: 2.4.2.0 (2.4.2.0)
Syntax
C#
VB
C++
F#
Copy
protected ModelClientValidationRule GetBasicRule(
    string type
)
Protected Function GetBasicRule (
    type As String
) As ModelClientValidationRule
protected:
ModelClientValidationRule^ GetBasicRule(
    String^ type
)
member GetBasicRule :
        type : string -> ModelClientValidationRule

Parameters

type
Type: SystemString
The validation type.

Return Value

Type: ModelClientValidationRule
Client validation rule with the basic set of parameters.
See Also

Reference

ExpressiveValidatorT Class
ExpressiveAnnotations.MvcUnobtrusive.Validators Namespace


RequiredIfValidator Class

RequiredIfValidator Class
Model validator for RequiredIfAttribute.
Inheritance Hierarchy
SystemObject
ModelValidator
DataAnnotationsModelValidator
DataAnnotationsModelValidator RequiredIfAttribute
ExpressiveAnnotations.MvcUnobtrusive.ValidatorsExpressiveValidator RequiredIfAttribute
ExpressiveAnnotations.MvcUnobtrusive.ValidatorsRequiredIfValidator

Namespace: ExpressiveAnnotations.MvcUnobtrusive.Validators
Assembly: ExpressiveAnnotations.MvcUnobtrusive (in ExpressiveAnnotations.MvcUnobtrusive.dll) Version: 2.4.2.0 (2.4.2.0)
Syntax
C#
VB
C++
F#
Copy
public class RequiredIfValidator : ExpressiveValidator<RequiredIfAttribute>
Public Class RequiredIfValidator
    Inherits ExpressiveValidator(Of RequiredIfAttribute)
public ref class RequiredIfValidator : public ExpressiveValidator<RequiredIfAttribute^>
type RequiredIfValidator =
    class
        inherit ExpressiveValidator<RequiredIfAttribute>
    end

The RequiredIfValidator type exposes the following members.

Constructors
 | Name | Description
Public method | RequiredIfValidator | Initializes a new instance of the RequiredIfValidator class.
Top
Properties
 | Name | Description
Protected property | ConstsMap | Gets names and values of constants extracted from specified expression within given context. (Inherited from ExpressiveValidatorT.)
Protected property | Expression | Gets the expression. (Inherited from ExpressiveValidatorT.)
Protected property | FieldsMap | Gets names and coarse types of properties extracted from specified expression within given context. (Inherited from ExpressiveValidatorT.)
Protected property | FormattedErrorMessage | Gets the formatted error message. (Inherited from ExpressiveValidatorT.)
Protected property | ParsersMap | Gets properties names and parsers registered for them via ValueParserAttribute. (Inherited from ExpressiveValidatorT.)
Top
Methods
 | Name | Description
Protected method | GetBasicRule | Generates client validation rule with the basic set of parameters. (Inherited from ExpressiveValidatorT.)
Public method | GetClientValidationRules | Retrieves a collection of client validation rules (which are next sent to browsers). (Overrides DataAnnotationsModelValidator.GetClientValidationRules.)
Top
See Also

Reference

ExpressiveAnnotations.MvcUnobtrusive.Validators Namespace


RequiredIfValidator Constructor

RequiredIfValidator Constructor
Initializes a new instance of the RequiredIfValidator class.

Namespace: ExpressiveAnnotations.MvcUnobtrusive.Validators
Assembly: ExpressiveAnnotations.MvcUnobtrusive (in ExpressiveAnnotations.MvcUnobtrusive.dll) Version: 2.4.2.0 (2.4.2.0)
Syntax
C#
VB
C++
F#
Copy
public RequiredIfValidator(
    ModelMetadata metadata,
    ControllerContext context,
    RequiredIfAttribute attribute
)
Public Sub New (
    metadata As ModelMetadata,
    context As ControllerContext,
    attribute As RequiredIfAttribute
)
public:
RequiredIfValidator(
    ModelMetadata^ metadata,
    ControllerContext^ context,
    RequiredIfAttribute^ attribute
)
new :
        metadata : ModelMetadata *
        context : ControllerContext *
        attribute : RequiredIfAttribute -> RequiredIfValidator

Parameters

metadata
Type: ModelMetadata
The model metadata instance.
context
Type: ControllerContext
The controller context instance.
attribute
Type: ExpressiveAnnotations.AttributesRequiredIfAttribute
The expressive requirement attribute instance.
Exceptions
Exception | Condition
ValidationException |
See Also

Reference

RequiredIfValidator Class
ExpressiveAnnotations.MvcUnobtrusive.Validators Namespace


RequiredIfValidator Properties

RequiredIfValidator Properties

The RequiredIfValidator type exposes the following members.

Properties
 | Name | Description
Protected property | ConstsMap | Gets names and values of constants extracted from specified expression within given context. (Inherited from ExpressiveValidatorT.)
Protected property | Expression | Gets the expression. (Inherited from ExpressiveValidatorT.)
Protected property | FieldsMap | Gets names and coarse types of properties extracted from specified expression within given context. (Inherited from ExpressiveValidatorT.)
Protected property | FormattedErrorMessage | Gets the formatted error message. (Inherited from ExpressiveValidatorT.)
Protected property | ParsersMap | Gets properties names and parsers registered for them via ValueParserAttribute. (Inherited from ExpressiveValidatorT.)
Top
See Also

Reference

RequiredIfValidator Class
ExpressiveAnnotations.MvcUnobtrusive.Validators Namespace


RequiredIfValidator Methods

RequiredIfValidator Methods

The RequiredIfValidator type exposes the following members.

Methods
 | Name | Description
Protected method | GetBasicRule | Generates client validation rule with the basic set of parameters. (Inherited from ExpressiveValidatorT.)
Public method | GetClientValidationRules | Retrieves a collection of client validation rules (which are next sent to browsers). (Overrides DataAnnotationsModelValidator.GetClientValidationRules.)
Top
See Also

Reference

RequiredIfValidator Class
ExpressiveAnnotations.MvcUnobtrusive.Validators Namespace


RequiredIfValidator.GetClientValidationRules Method

RequiredIfValidatorGetClientValidationRules Method
Retrieves a collection of client validation rules (which are next sent to browsers).

Namespace: ExpressiveAnnotations.MvcUnobtrusive.Validators
Assembly: ExpressiveAnnotations.MvcUnobtrusive (in ExpressiveAnnotations.MvcUnobtrusive.dll) Version: 2.4.2.0 (2.4.2.0)
Syntax
C#
VB
C++
F#
Copy
public override IEnumerable<ModelClientValidationRule> GetClientValidationRules()
Public Overrides Function GetClientValidationRules As IEnumerable(Of ModelClientValidationRule)
public:
virtual IEnumerable<ModelClientValidationRule^>^ GetClientValidationRules() override
abstract GetClientValidationRules : unit -> IEnumerable<ModelClientValidationRule>
override GetClientValidationRules : unit -> IEnumerable<ModelClientValidationRule>

Return Value

Type: IEnumerable ModelClientValidationRule
A collection of client validation rules.
See Also

Reference

RequiredIfValidator Class
ExpressiveAnnotations.MvcUnobtrusive.Validators Namespace