0

I have a var variable where it has set of objects. I want to query a particular object and hide/delete 2 rows based on ID.

I am trying to select the value as below but still it is not working. Any help is greatly appreciated.

var getTransformDetails = contentView.Package; if(totalCost > 100000) { getTransformDetails.AnnualPaymentGrid.Where(x => x.Id != XXXXX1 || x.Id != XXXXX2); }

Kar B
  • 1
  • 1
  • 2
    You need to assing the result back to the variable, otherwise you're filtering and throwing the results away. – Alejandro Mar 15 '21 at 17:46
  • The documentation for [`Enumerable.Where`](https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.where?view=net-5.0#System_Linq_Enumerable_Where__1_System_Collections_Generic_IEnumerable___0__System_Func___0_System_Boolean__) is a good place to start. – NetMage Mar 16 '21 at 00:33
  • Does this answer your question? [Filtering collections in C#](https://stackoverflow.com/questions/26196/filtering-collections-in-c-sharp) – NetMage Mar 16 '21 at 00:34

0 Answers0