public TodoListDto MapToDto(TodoList obj) { TodoListDto dto = new TodoListDto(); dto.id = obj.GetId(); dto.name = obj.GetName(); dto.description = obj.GetDescription(); return(dto); }
public void Update(TodoList todoList) { using (NpgsqlConnection connection = DatabaseService.CreateConnection()) { connection.Open(); NpgsqlCommand query = new NpgsqlCommand("update schedules set name = @name, description= @description where id = @id", connection); query.Parameters.AddWithValue("id", todoList.GetId()); query.Parameters.AddWithValue("task_name", todoList.GetName()); query.Parameters.AddWithValue("description", todoList.GetDescription()); query.ExecuteNonQuery(); } }