public static TasksList AddTask(TasksList state, TvAction action) { if (action.Name == "ADD_TASK") { var num = state.Count; var newState = new TasksList(); newState.AddRange(state); newState.Add(new TaskData() { Message = $"I am task #{num + 1}" }); return(newState); } return(state); }