I have and object of type ct_CompleteOrder and have following classes:
ct_CompleteOrder class
public partial class ct_CompleteOrder {
private ct_CompleteOrderPayments paymentsField;
}
ct_CompleteOrderPayments class
public partial class ct_CompleteOrderPayments {
private ct_Payment[] paymentField;
public ct_Payment[] Payment {
get {
return this.paymentField;
}
set {
this.paymentField = value;
}
}
}
ct_Payment class
public partial class ct_Payment {
public string type{get; set;}
}
I want to remove elements of the ct_Payment
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?
completeOrder.Payments.Payment.ToList().RemoveAll(x => x.type == "AUTO");