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

Result factory methods uses IEnumerable instead of List for "array" type responses #100

Merged
merged 3 commits into from
Apr 14, 2021

Conversation

egil
Copy link
Contributor

@egil egil commented Mar 19, 2021

This changes the factory methods to use IEnumerable instead of List, and keeps the implicit conversions from List, to avoid a breaking change.

Should we consider IReadOnlyList instead?

Closes #99.

@egil egil added the enhancement New feature or request label Mar 19, 2021
@egil egil self-assigned this Mar 19, 2021
@egil
Copy link
Contributor Author

egil commented Mar 22, 2021

@LarsSkovslund and I agree that IEnumerable<T> is good for this use case. If the user wants the endpoint to return e.g. both a list and a count, they will specify an object in the api spec that contains both, and that will not fall under this scenario anyway.

@egil egil requested review from davidkallesen and removed request for LarsSkovslund April 13, 2021 08:56
@egil egil force-pushed the feature/99-result-abstract branch from 92f1bde to 1ecf670 Compare April 14, 2021 10:51
@egil egil closed this Apr 14, 2021
@egil egil deleted the feature/99-result-abstract branch April 14, 2021 11:02
@egil egil restored the feature/99-result-abstract branch April 14, 2021 11:03
@egil egil reopened this Apr 14, 2021
@davidkallesen davidkallesen merged commit 41d0173 into main Apr 14, 2021
@davidkallesen davidkallesen deleted the feature/99-result-abstract branch April 14, 2021 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

All "result" types should take an IEnumerable<T> as input instead of List<T>.
2 participants