I have a custom list List. which returns all items. The structure of Info is as follows:
public class Info
{
public string Code { get; set; }
public string ClinicianDescription { get; set; }
}
I want to exclude any Info objects from the list where the Code property equels any value in a separate List.
Just after a clean way to do this, i've tried using .Except(), but i would have to convert the List into the same object which seems incorrect.
I've tried something like this so far:
List<int> ids = contactList;
var List<Info> test = info.RemoveAll(x => ids.Any(i => i == x.Code));