eshurak
asked on
Remove item from List<> using delegates
Using C# and VS2005 in an ASP.NET project I need to remove an item from a list<>. Here's what I've got so far. The problem is my list is based on a custom object (PartnerRecord) so I'm trying to use delegates to create a record to remove, but I'm open to anything.
List<PartnerRecord> results = Session["FilteredPartners" ] as List<PartnerRecord>;
results.Remove(delegate(Pa rtnerRecor d pr1)
{ return pr1.ID.Equals(ResultsGrid. Items[i].K eyValues.T oString(), StringComparison.CurrentCu ltureIgnor eCase); });
List<PartnerRecord> results = Session["FilteredPartners"
results.Remove(delegate(Pa
{ return pr1.ID.Equals(ResultsGrid.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The problem was in my delegate.
Open in new window