vescon / MethodBoundaryAspect.Fody

A Fody weaver which allows to decorate methods and hook into method start, method end and method exceptions.
MIT License
251 stars 75 forks source link

It is possilbe to make a Retry attribute? #91

Open shuizhugeju opened 2 years ago

shuizhugeju commented 2 years ago

It is possilbe to make a Retry attribute

Ralf1108 commented 2 years ago

Unfortunately with our aspect it is only possible to execute code before and after the method call but it is not possible to reexecute the weaved method.

In PostSharp this is possible via the MethodInterceptionAspect

Alternative to AOP you can use the Polly library to create error handling and mitigating policies in code: https://github.com/App-vNext/Polly

Ralf1108 commented 2 years ago

example retry Polly policy: https://github.com/App-vNext/Polly#retry