I have a list of objects, the objects have the following properties
public class oItem {
public decimal nit_codit { get; set; }
... etc
}
Then I have the list of objects
List<oItem> PlItens = new List<oItem>();
Let's suppose that the list was loaded with n records, I want to remove the objects whose nit_codit property is 0 from the list.
I tried:
if (PlItens.Exists(x => x.nit_codit == 0)) {
PlItens.Remove(x);
}
And also:
PlItens.Remove(x => x.nit_codit == 0);
But by the way it's not like this .. does anyone know how to do it?