DeclaringMember(IEligibilityBuilder<IParameter>)
Gets an IEligibilityBuilder for the declaring method, property, indexer, or event of the parameter validated by the given IEligibilityBuilder.
Declaration
public static IEligibilityBuilder<IHasParameters> DeclaringMember(this IEligibilityBuilder<IParameter> eligibilityBuilder)Parameters
| Type | Name | Description |
|---|---|---|
| IEligibilityBuilder<IParameter> | eligibilityBuilder | The parent eligibility builder for a parameter. |
Returns
| Type | Description |
|---|---|
| IEligibilityBuilder<IHasParameters> | An eligibility builder for the declaring member (method, property, indexer, or event) that contains the parameter. |
Remarks
Use this method to add requirements on the member that declares a parameter. For example, you can require that a parameter's declaring method is not static, or that it has specific attributes.
When validation fails on the declaring member, the error message will clearly indicate that it's the declaring member that doesn't meet the requirement.