-
Notifications
You must be signed in to change notification settings - Fork 49
Can't use System.Linq Queryable extension methods #198
Copy link
Copy link
Open
Description
Trying to use IEnumerable.AsQueryable causes a compilation error, even after adding @using System.Linq.
Reproduction:
- Snippet: https://try.mudblazor.com/snippet/wYmKEnGwLAhKlUnI
- Code:
@using System.Linq <MudText Typo="Typo.h6">MudBlazor is @Text</MudText> <MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="ButtonOnClick">@ButtonText</MudButton> @code { public string Text { get; set; } = "????"; public string ButtonText { get; set; } = "Click Me"; public int ButtonClicked { get; set; } void ButtonOnClick() { IEnumerable<string> data = new List<string>() { "a", "b", "c" }; data = data.Select(x => x.ToUpper()).ToArray(); // This works data = data.AsQueryable().Select(x => x.ToUpper()).ToArray(); // this doesn't ButtonClicked += 1; Text = $"Awesome x {ButtonClicked} ({string.Join(",", data)})"; ButtonText = "Click Me Again"; } }
- Expected: Adding
@using System.Linqshould fix the compilation error - What actually happens: It doesn't.
- Browser: Firefox 148.0.2 (64-bit), on windows, normal mode (not incognito/private)
- DotNET version: 10.0.3
- MudBlazor version: v9.1.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels