@rendermode InteractiveServer @using BlazorWeb1.Server

Todo (@todos.Count(todo => !todo.IsDone))

@code { private List todos = new(); string newTodo = ""; void AddTodo() { if (!string.IsNullOrWhiteSpace(newTodo)) { todos.Add(new TodoItem { Title = newTodo }); newTodo = string.Empty; } } }