-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components
Description
I have a simple JavaScript helper:
window.debugOut = (content) => {
console.dir(content);
}On the Blazor side I have this type:
public class City
{
public string CityName { get; set; }
public int Population { get; set; }
}If I call the JavaScript debugOut and pass a List<City>, this arrives correctly on the browser side:
await Js.InvokeAsync<bool>("debugOut", new List<City> {
new City{CityName="London",Population=8000000 },
new City{CityName="Edinburgh", Population=400000 }
});But if I use an array type instead, the browser only sees the first object:
await Js.InvokeAsync<bool>("debugOut", new City[] {
new City{CityName="London",Population=8000000 },
new City{CityName="Edinburgh", Population=400000 }
});Serialization works correctly with an array of simple values. The problem seems to occur only with arrays of objects.
await Js.InvokeAsync<bool>("debugOut", new int[] { 1, 2, 3 });Metadata
Metadata
Assignees
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components


