3
I have a list of objects, objects have the following properties
public class oItem {
public decimal nit_codit { get; set; }
... etc
}
So I have the list of objects
List<oItem> PlItens = new List<oItem>();
Suppose the list was loaded with n records, I want to remove from the list, objects whose nit_codit property is 0..
I tried to:
if (PlItens.Exists(x => x.nit_codit == 0)) {
PlItens.Remove(x);
}
And also:
PlItens.Remove(x => x.nit_codit == 0);
But apparently it’s not like that. Somebody knows how to do it.?
You’re trying to remove a list of data and not just data, right?
– CesarMiguel
You were almost @William the second way was to just complete the remove.
– Diego Filipe Pedro Santos
Thanks to all the answers, it worked with the solution of @Diegosantos, again, thank you all.
– William de Castro