TryGetDeclaration<T>(IIntroductionAdviceResult<T>, out T?)
Attempts to get the declaration (method, property, field, event, type, or operator) that was introduced by the advice, if the advice was successful.
Declaration
public static bool TryGetDeclaration<T>(this IIntroductionAdviceResult<T> adviceResult, out T? declaration) where T : class, IDeclarationParameters
| Type | Name | Description |
|---|---|---|
| IIntroductionAdviceResult<T> | adviceResult | The advice result to check. |
| T | declaration | When this method returns |
Returns
| Type | Description |
|---|---|
| bool |
|
Type Parameters
| Name | Description |
|---|---|
| T | The type of declaration (e.g., IMethod, IProperty, IField, IEvent, INamedType). |
Remarks
When the introduced declaration is a type, the IIntroductionAdviceResult<T> interface itself implements IAdviser<T> and can be used to introduce members to the type.