Show / Hide Table of Contents

Class SpecificationEx

Class containing some extension methods for ISpecification<T>.

Inheritance
System.Object
SpecificationEx
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace:Extend
Assembly:Extend.dll
Syntax
public static class SpecificationEx

Methods

| Improve this Doc View Source

And<T>(ISpecification<T>, Func<T, Boolean>, String)

Combines the current specification with the given expression using an AND link.

Declaration
public static ISpecification<T> And<T>(this ISpecification<T> specification, Func<T, bool> expression, string message = null)
Parameters
Type Name Description
ISpecification<T><T> specification

The current specification.

System.Func<T, TResult><T, System.Boolean> expression

The expression to add.

System.String message

The validation error message.

Returns
Type Description
ISpecification<T><T>

Returns the combined specifications.

Type Parameters
Name Description
T The target type of the specification.
Exceptions
Type Condition
System.ArgumentNullException

specification can not be null.

System.ArgumentNullException

expression can not be null.

| Improve this Doc View Source

Or<T>(ISpecification<T>, Func<T, Boolean>, String)

Combines the current specification with the given expression using a OR link.

Declaration
public static ISpecification<T> Or<T>(this ISpecification<T> specification, Func<T, bool> expression, string message = null)
Parameters
Type Name Description
ISpecification<T><T> specification

The current specification.

System.Func<T, TResult><T, System.Boolean> expression

The expression to add.

System.String message

The validation error message.

Returns
Type Description
ISpecification<T><T>

Returns the combined specifications.

Type Parameters
Name Description
T The target type of the specification.
Exceptions
Type Condition
System.ArgumentNullException

specification can not be null.

System.ArgumentNullException

expression can not be null.

| Improve this Doc View Source

XOr<T>(ISpecification<T>, Func<T, Boolean>, String)

Combines the current specification with the given expression using a XOr link.

Declaration
public static ISpecification<T> XOr<T>(this ISpecification<T> specification, Func<T, bool> expression, string message = null)
Parameters
Type Name Description
ISpecification<T><T> specification

The current specification.

System.Func<T, TResult><T, System.Boolean> expression

The expression to add.

System.String message

The validation error message.

Returns
Type Description
ISpecification<T><T>

Returns the combined specifications.

Type Parameters
Name Description
T The target type of the specification.
Exceptions
Type Condition
System.ArgumentNullException

specification can not be null.

System.ArgumentNullException

expression can not be null.

  • Improve this Doc
  • View Source
Back to top Copyright © 2015-2016 Microsoft
Generated by DocFX