pamidur / aspect-injector

AOP framework for .NET (c#, vb, etc)
Apache License 2.0
772 stars 115 forks source link

Feature: Why `GetInstance` method for Factory should be static? #216

Closed IbrahimElshafey closed 1 year ago

IbrahimElshafey commented 1 year ago

Why not something similar to JobActivator ? to enable easy use.

pamidur commented 1 year ago

What syntax would you like for aspect? Can you give an example?

On Wed, 24 May 2023, 23:55 Ibrahim Ragab, @.***> wrote:

Why not something similar to JobActivator https://docs.hangfire.io/en/latest/background-methods/using-ioc-containers.html? to enable easy use.

— Reply to this email directly, view it on GitHub https://github.com/pamidur/aspect-injector/issues/216, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7HZUB5FIXTPS3GRLVPPULXHXZKJANCNFSM6AAAAAAYNILNLQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

pamidur commented 1 year ago

It took me some time to understand. The reason is that Aspect Injectior might not be able to instantiate the factory class. Inside static GetInstance method you may hook it to any DI you like though

pamidur commented 1 year ago

In future I plan for better DI frameworks support. For now I'll close the issue, but feel free to reopen if needed