Skip to content

如何在被拦截方法获取AspectContext对象呢? #328

@xiazhaozhao

Description

@xiazhaozhao

代码如下:
` public async override Task Invoke(AspectContext context, AspectDelegate next)
{
try
{
Console.WriteLine("Before service call");
context.AdditionalData.Add("CustomData", "CustomValue");

     await next(context);
 }
 catch (Exception)
 {
     Console.WriteLine("Service threw an exception!");
     throw;
 }
 finally
 {
     Console.WriteLine("After service call");
 }

}` 如何在被拦截方法中获取到AspectContext 对象内的AdditionalData字典数据呢?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions