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

Support different response type than the input type #7792

Open
Tracked by #8356
JuganD opened this issue Jul 10, 2023 · 1 comment
Open
Tracked by #8356

Support different response type than the input type #7792

JuganD opened this issue Jul 10, 2023 · 1 comment

Comments

@JuganD
Copy link

JuganD commented Jul 10, 2023

Is your feature request related to a problem? Please describe.
In the ES 7 NEST Client it was possible to send a request using SearchAsync, which has a Query with a generic type of a base class and then cast it to a child class. Currently, sending such request using SearchRequestDescriptor<TDocument> parameter, outputs already casted elements to the particular TDocument type.

Describe the solution you'd like
It would be nice to have an overload of SearchAsync, which accepts another generic type than the provided input type and casts the response results to it.

Describe alternatives you've considered
Not sure if there is an alternative currently, I considered changing the generic types of the descriptors to the requested ones, but with huge codebase with many document types, the code reusability goes down considerably.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants