Ejemplo n.º 1
0
 //Intercept asynchronous methods
 public override Task BeforeAsync(FreeSql.DynamicProxyArguments args)
 {
     if (args.MemberInfo.Name == "GetAsync")
     {
         args.ReturnValue = "BeforeAsync GetAsync NewValue";
     }
     return(Task.CompletedTask);
 }
Ejemplo n.º 2
0
 public override void Before(FreeSql.DynamicProxyArguments args)
 {
     if (args.MemberInfo.Name == "Get")
     {
         args.ReturnValue = "Before Get NewValue";
     }
     if (args.MemberInfo.Name == "Text")
     {
         args.ReturnValue = "Before Text NewValue";
     }
 }
 /// <summary>
 /// 异步方法执行之前,处理返回值为 Task/Task&lt;T&gt; 的异步方法
 /// </summary>
 /// <param name="args"></param>
 /// <returns></returns>
 public virtual Task AfterAsync(DynamicProxyArguments args) => Task.FromResult(false);
 /// <summary>
 /// 同步方法执行之后
 /// </summary>
 /// <param name="args"></param>
 public virtual void After(DynamicProxyArguments args)
 {
 }
 /// <summary>
 /// 同步方法执行之前
 /// </summary>
 /// <param name="args"></param>
 public virtual void Before(DynamicProxyArguments args)
 {
 }
Ejemplo n.º 6
0
 public override void After(FreeSql.DynamicProxyArguments args)
 {
 }