Remove element from list using linq : <p>I have and object of type ct_CompleteOrder and have following classes:</p>

<p><strong>ct_CompleteOrder class</strong></p>

<pre><code>public partial class ct_CompleteOrder {
    private ct_CompleteOrderPayments paymentsField;
}
</code></pre>

<p><strong>ct_CompleteOrderPayments class</strong></p>

<pre><code>public partial class ct_CompleteOrderPayments {
    private ct_Payment[] paymentField;
    public ct_Payment[] Payment {
    get {
        return this.paymentField;
        }
    set {
        this.paymentField = value;
        }
    }
}
</code></pre>

<p><strong>ct_Payment class</strong></p>

<pre><code>public partial class ct_Payment {
    public string type{get; set;}
}
</code></pre>

<p>I want to remove elements of the <code>ct_Payment</code> array on the basis of type value. I tried to convert it into list first to apply RemoveAll, but its not working. what am I doing wrong?</p>

<pre><code>completeOrder.Payments.Payment.ToList().RemoveAll(x =&gt; x.type == "AUTO");
</code></pre>
