Summary
Creates IsTypeSpecification<T>
for candidate property:
Checks if candidate property is compatible with a given type.
Syntax
[PublicAPI]
[NotNull]
public static IComplexSpecification<T> IsType<T, TProperty>(Expression<Func<T, TProperty>> selector, Type expected)
Attributes
Type |
Description |
PublicAPI |
|
NotNull |
|
Type Parameters
Name |
Description |
T |
Type of candidate. |
TProperty |
Type of candidate property to verification. |
Parameters
Name |
Type |
Description |
selector |
Expression<Func<T, TProperty>> |
Candidate property selector. |
expected |
Type |
Expected type of candidate property. |
Return Value
Exceptions
Type |
Description |
System.ArgumentNullException |
Thrown when selector is null. |
System.ArgumentException |
Thrown when selector is not valid. |
System.ArgumentNullException |
Thrown when expected is null. |