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

Allow static Expression injection for instance methods #51

Closed
akarboush opened this issue Aug 19, 2024 · 0 comments · Fixed by #52
Closed

Allow static Expression injection for instance methods #51

akarboush opened this issue Aug 19, 2024 · 0 comments · Fixed by #52

Comments

@akarboush
Copy link
Contributor

Following up on #50 (Add custom InjectLambdaAttribute provider), I've just noticed that the current implementation doesn't allow mixing static and non static methods when injecting,

// mixed static and non-static methods?
if (factory.IsStatic != isStatic)
throw FailFactory(target, factory.Name, $"{(isStatic ? "static" : "non-static")} implementation expected");

which is often needed when working with external code. I think if we want to make this feature more useful, we should allow the expression to be static, since the method that needs to be translated will most likely be an instance method.

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

Successfully merging a pull request may close this issue.

1 participant