-
Notifications
You must be signed in to change notification settings - Fork 475
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
Simplify reflection of classes generated by annotations framework #1760
Comments
What attribute do you suggest putting on the generated handler? I don't want something that users could get confused an attempt to use themselves in their code. If we can agree on attribute I don't see any reason we couldn't add the feature, would you be interested in contributing a PR? |
I didn't do any research regarding the best attribute type. I remember both EF and WCF decorating their generated code with Another option would be to use something from the The only option seems to be the creation of a ad-hoc attribute and then use reflection to extract its values without having the attribute type definition available (although I'm not sure about whether a type defined in the Annotation assembly is not available down the line). Regarding working on the pull request, I would need some guidance or at least some docs to understand the code generation process. I saw there are both PS: I would assume changing the name of the generated method to a fixed value is too big of a breaking change? |
@normj I got some time to look at this. Do you have the time to finalize the discussion bullets above? |
I like idea of using We have also had some discussion of reworking the generator function name because the generated name can exceed the limit that can fit in the Function Handler property. So it would be good to have add this to move away from assuming the function's generated name. |
Would you consider changing the name of the generated method a breaking change worth of a major semver hop? |
Possibly, we haven't figured out the approach how we want to handle the issue. One approach is still generate the current format and a new format so anybody reference the current format would still work. If we do it that way then I think we would move the |
Describe the feature
I'm using reflection to find the class generated by the annotation framework.
Whilst the approach is easily reproducible because the class name is "{Class}_{Method}_Generated" and the method is Method, it would be easier if the generated class was decorated with a attribute (possibly one coming from the BCL) that can be used to quickly find the generated class given the original class/function.
Additionally, it would be great if the generated class had the method with a fixed name like Handle or whatever.
Using a marking attribute and maybe even some interface with a single Handle method would make the process easier and less relying on internal implementation.
Use Case
I'm working on a tool to improve development experience when working with Annotations Lambda
Proposed Solution
No response
Other Information
No response
Acknowledgements
AWS .NET SDK and/or Package version used
Any
Targeted .NET Platform
.NET 8 + Aspire
Operating System and version
Any
The text was updated successfully, but these errors were encountered: