public TodoViewModel(Todo t) { this.id = t.Id; this.text = t.Text; this.done = t.Done; this.order = t.Order; }
public TodoViewModel Post(TodoViewModel newTodo) { var todo = new Todo{Done = newTodo.done, Order = newTodo.order, Text = newTodo.text}; repository.Add(todo); repository.Save(); return new TodoViewModel(todo); }