In Metalama, members of the target declaration do not need to be imported into the aspect. Instead, the aspect accesses the target code using dynamic code or invokers. To generate code that calls a method, use IMethod.Invoke(params dynamic?[]). To generate code that accesses a field or property, use IFieldOrProperty.Value.
Namespace: PostSharp.Aspects.Advices
Assembly: Metalama.Migration.dll
Syntax
[AttributeUsage(AttributeTargets.Field)]
[Obsolete("In Metalama, members of the target declaration do not need to be imported into the aspect. Instead, the aspect accesses the target code using dynamic code or invokers. To generate code that calls a method, use 'IMethod'.'IMethodInvoker.Invoke(params dynamic?[])'. To generate code that accesses a field or property, use 'IFieldOrProperty'.'IExpression.Value'.", false)]
public sealed class ImportMemberAttribute : AdviceConstructors
| Name | Description |
|---|---|
| ImportMemberAttribute(string) | |
| ImportMemberAttribute(params string[]) |
Properties
| Name | Description |
|---|---|
| IsRequired | |
| MemberNames | |
| Order |