@using Microsoft.AspNetCore.Components.Forms
Initialization Sequence

Register a new asset node into the core product catalog matrix.

@for (int i = 0; i < 5; i++) { var index = i;
@if (HasAssetAt(index)) { Slot @(index + 1) } else {
0@(index + 1)
}
}
@code { private Product ProductModel { get; set; } = new(); protected override void OnInitialized() { ProductModel.Active = true; ProductModel.Thumbnails ??= new string[0]; } private bool HasAssetAt(int index) => ProductModel.Thumbnails != null && index < ProductModel.Thumbnails.Length && !string.IsNullOrWhiteSpace(ProductModel.Thumbnails[index]); private void RemoveThumbnailAt(int index) { if (ProductModel.Thumbnails == null) return; var list = ProductModel.Thumbnails.ToList(); if (index < list.Count) { list.RemoveAt(index); ProductModel.Thumbnails = list.ToArray(); } } private void HandleValidSubmit() { // Save operation business logic goes here } public class Product { public Guid Id { get; set; } = Guid.NewGuid(); public string? Name { get; set; } public string? Summary { get; set; } public string? Description { get; set; } public string? ImageUrl { get; set; } public string[]? Thumbnails { get; set; } public bool Active { get; set; } } }