Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

if define atribute for interface its not worked for all calass that implemeted its #569

Closed
BQFiruz opened this issue Aug 22, 2023 · 3 comments

Comments

@BQFiruz
Copy link

BQFiruz commented Aug 22, 2023

hi
if define atribute for interface its not worked for all calass that implemeted its
how can use its for interfaces

public sealed class TransactionScopeAttribute : OnMethodBoundaryAspect
{
    public override void OnEntry(MethodExecutionArgs args)
    {
        args.MethodExecutionTag = new TransactionScope();
    }

    public override void OnExit(MethodExecutionArgs args)
    {
        var transactionScope = (TransactionScope)args.MethodExecutionTag;

        transactionScope.Complete();
        transactionScope.Dispose();
    }

    public override void OnException(MethodExecutionArgs args)
    {
        var transactionScope = (TransactionScope)args.MethodExecutionTag;

        transactionScope.Dispose();
    }
}
[TransactionScope]
public interface ISample
{
    void Method();
}

public class Sample : ISample
{
    public int id { get; set; }
    public void Method()
    {
        Debug.WriteLine("Do some database stuff isolated in surrounding transaction");
    }
}
@ltrzesniewski
Copy link
Member

I think your issue should be raised in the weaver repo: https://github.com/vescon/MethodBoundaryAspect.Fody

@BQFiruz
Copy link
Author

BQFiruz commented Aug 23, 2023 via email

@SimonCropp
Copy link
Member

@BQFiruz completed is just the default behavior of github wen u close an issue. u need to raise the issue in the correct repository https://github.com/vescon/MethodBoundaryAspect.Fody

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants