-
Notifications
You must be signed in to change notification settings - Fork 10k
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
RDG does not support private parameter and return types #47339
Comments
Yeah, our best option is to emit a diagnostic and fallback to the runtime behavior here. Even if we solve the problem of having to use the unspeakable names in the strongly-typed endpoint overloads (via the interceptors proposal say), we still have the dilemma of needing to reference these types in the generated request handlers when we bind parameters or emit responses. #47338 is similar but, unlike this one, it is solvable if we implement support for generic thunks in the request delegate generator. This is one of these issues I'd be curious to get community feedback one once RDG is out. I dunno how common it is to have private DTO classes considering that you might need to access them in unit or integration tests. |
I think this should be moved out of preview4 for now. |
Thanks for contacting us. We're moving this issue to the |
Given the code:
RDG generates code that fails to compile because
MyDto
is a private type. The lines that cause the compilation failure by referencing the private type are basically the same lines that fail with an undefinedTUser
in #47338 which is the equivalent issue about generic types.We can skip generating
MapPost
and similar methods when we see a private type in the delegate signature and suggest using internal types instead. I don't think we really have an alternative unless we could somehow generate ourMap
extension methods directly in the same class/struct the user is calling it from. I don't know of any plans for that.The text was updated successfully, but these errors were encountered: