Expose QueryDefinition parameters
See original GitHub issueIs your feature request related to a problem? Please describe.
With the current API the parameters on QueryDefinition
are write-only (can only be added with WithParameter
). There’s no way to access the parameters already added to the query definition.
On the other hand, the QueryText
is read-only, so I can’t change it.
This means there’s no way I can’t change query definition by modifying an existing one, and I also can’t make a new one by copying the parameters from an existing one.
Describe the solution you’d like At least, the parameters should be publicly exposed. Probably with a property like this:
public IReadOnlyDictionary<string, object> Parameters { get; }
To make things simpler, there should also be a WithParameters(IReadOnlyDictionary<string, object> parameters)
method.
This would make it easy to copy an existing QueryDefinition
:
var newDefinition = new QueryDefinition(definition.QueryText).WithParameters(definition.Parameters);
(Admittedly the code above wouldn’t be very useful, since it would make an exact copy of the query definition. In a real scenario the query text and / or parameters would be modified)
Describe alternatives you’ve considered Nothing I can think of.
Additional context N/A
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:8 (7 by maintainers)
Top GitHub Comments
@thomaslevesque Any chance to get the conflicts resolved and get your solution merged? Found myself writing some ugly reflection code again.
If this change is accepted, I can submit a PR