The Wayback Machine - https://web.archive.org/web/20220215142026/https://github.com/dotnet/aspnetcore/issues/40247
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

Virtualize component's Items property should be IReadOnlyCollection #40247

Open
egil opened this issue Feb 15, 2022 · 0 comments
Open

Virtualize component's Items property should be IReadOnlyCollection #40247

egil opened this issue Feb 15, 2022 · 0 comments

Comments

@egil
Copy link
Contributor

@egil egil commented Feb 15, 2022

Background and Motivation

The <Virtualize TItem="T"> component should allow users to pass a IReadOnlyCollection<T> to the Items property/parameter instead of requiring an ICollection.

There should be no need for the Virtualize component to change the collection passed to it, so changing the parameter to an IReadOnlyCollection<T> should be a non-breaking change, that allows users to pass a wider range of collection types (including custom ones) to the Virtualize component.

Proposed API change to Virtualize.cs

/// <summary>
/// Gets or sets the fixed item source.
/// </summary>
[Parameter]
-public ICollection<TItem>? Items { get; set; }
+public IReadOnlyCollection<TItem>? Items { get; set; }

Usage Examples

N/A

Alternative Designs

N/A

Risks

There should be no breaking changes (ICollection implements IReadOnlyCollection), and performance should be the same.

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

Successfully merging a pull request may close this issue.

None yet
1 participant