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

Search: Make SuggestResults.Results read only #13003

Merged
merged 2 commits into from
Jun 25, 2020

Conversation

tg-msft
Copy link
Member

@tg-msft tg-msft commented Jun 25, 2020

Fixes #12936 to be in compliance with the guidelines

Copy link
Member

@heaths heaths left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A nit, but otherwise LGTM.

/// <summary>
/// The sequence of suggestions returned by the query.
/// </summary>
public IReadOnlyList<SearchSuggestion<T>> Results => _results;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this would still be castable to a mutable list, but I know we've done it this way elsewhere. Perhaps, though, you might consider wrapping _results in a ReadOnlyCollection that prevents this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It touches slightly more code, but it's a fair suggestion.

@tg-msft tg-msft merged commit 329193d into Azure:master Jun 25, 2020
prmathur-microsoft pushed a commit that referenced this pull request Jul 8, 2020
* Search: Make SuggestResults.Results read only

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

Successfully merging this pull request may close these issues.

Search: Make SuggestResults.Results an IReadOnlyList
2 participants