Esempio n. 1
0
        public static TodoState AddTodoAction(TodoState state, AddTodoAction action)
        {
            int index = state.Todos.Count;

            state.Todos.Add(new Model.Todo {
                Description = action.Description, Index = index
            });
            return(new TodoState(state.Todos));
        }
Esempio n. 2
0
 public static TodoState MarkAsDone(TodoState state, MarkAsDoneAction action)
 {
     state.Todos.Single(c => c.Index == action.Index).Done = true;
     return(new TodoState(state.Todos));
 }