"PM> Install-Package MethodDecorator.Fody" doesn´t work but "PM> Install-Package MethodDecoratorEx.Fody" does.
See original GitHub issueThe nuget package MethodDecorator.Fody doesn´t work on compile, keeps complaining about the IMethodDecorator
interface not being correct even after trying the folllowing:
public interface IMethodDecorator
{
void Init(object instance, MethodBase method, object[] args);
void OnEntry();
void OnExit();
void OnException(Exception exception);
}
and the older syntax
public interface IMethodDecorator
{
void Init(object instance, MethodBase method, object[] args);
void OnEntry(MethodBase method);
void OnExit(MethodBase method);
void OnException(MethodBase method, Exception exception);
}
I´ve tried defining the classes on root namespace and module register the attribute.
But got it working when i used the MethodDecoratorEx.Fody package instead:
[assembly: MethodDecorator]
public interface IMethodDecorator
{
void Init(object instance, MethodBase method, object[] args);
void OnEntry();
void OnExit();
void OnException(Exception exception);
}
I guess the MethodDecoratorEx.Fody
package has to be updated
Now the real problem I would like to open an issue/contribute on it´s fork @alexeysuvorov fork ( i.e MethodDecoratorEx.Fody) but it seems not to allow this.
I know post sharp(and it´s price), but being a big Python(decorators) fan but a .NET developer i´ve always wanted C# to have such capabilities without the overly complex CQRS ICommandHandler pattern well explained by “Famous” Steven
Issue Analytics
- State:
- Created 8 years ago
- Comments:18 (11 by maintainers)
Thanks for the info @ahmedalejo, I’ll keep an eye out for something easier. I don’t have a lot of time see. I did use postsharp when I wanted to do this sort of thing before but I’m trying to find an open source alternative.
closing this as stale. please raise a new issue if this is still a problem