Open VanKrock opened 5 years ago
Hi,
You have to implements method Argument
public Advice1 : IAdvice
{
private readonly List<object> arguments;
public void Argument<T>(ref T value)
{
this.arguments.Add(value);
}
public void Begin()
{
this.arguments... //here list of arguments?
}
...
}
It's will work if I call my method twice?
Yes, it depends how you create your "aspect/advisor"
public class Logging : Aspect
{
override public IEnumerable<Advisor> Manage(MethodBase method)
{
yield return Advice
.For(method)
.Around(() => new Log(method));
}
}
here the delegate to create 'Log Advice' is called each time you call your method. This is what I recommend to manage method call contextual datas. In this case you can even specialize an advice depending on target method.
IAdvice.Begin doesn't have method arguments
Arguments needed for templates, such as
IAdvice.Begin can be