Skip to content

Blazor Server vs WASM - different output on enumerable is ICollection<int> #111147

@tesar-tech

Description

@tesar-tech

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Blazor app and this code:

List<int> list = [1,2,3];
IEnumerable<int> enumerable =list.Take(2);
bool isCollection = enumerable is ICollection<int>;

Console.WriteLine($"is ICollection: {isCollection} "); //true on server, false on wasm

Expected Behavior

The result should be the same on Blazor Servers and Blazor Wasm.

Steps To Reproduce

Clone this bug report repo (simple blazor app), run the app and visit:

Exceptions (if any)

No response

.NET Version

9.0.100 (but was also on 8)

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions