-
Notifications
You must be signed in to change notification settings - Fork 738
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
C# extension methods are too limited for use in non-async code. #446
Comments
@stankovski thoughts on this? |
The header/correlation-id thing can be worked around with something in the pipeline, but ultimately hiding any parameters makes sync code a second-class citizen to async code. Where I work we have 1% async code, most of our work is enhancements rather than greenfield. Moving to REST is a Big Thing, and that's partially repurposing existing sync code. So, the question is, are you supporting sync code as a first class citizen? |
@koolraap If I see it correctly, your issue 1 also applies to the Async method, am I right? You can't inject custom header there either. Which is a bummer. We have the same problem. Currently moving to micro services, we need to create an ever increasing number of services and the code created by Autorest is quite useful for that. Yet we have to modify the code every time we create it (expose custom headers to sync- and async- methods, to include a correlation ID). Maybe another command line flag could be used, so the backward compatibility is kept? Something like -ExposeCustomHeader: Exposes the custom header attribute in the generated methods. ...` |
I would recommend adding a flag in autorest for C# to allow specifying what sync wrappers should be generated |
Thank you! |
The non-async methods generated in the C# FooBarExtensions.cs class are too limited for practical use.
The text was updated successfully, but these errors were encountered: