I have the following line of code in my controller that selects the id's of the interests shown within a view (they are listed down the page).
IEnumerable<int> interestIds = viewModel.ExistingInterests.Select(x => x.InterestId);
However I want to be able to add a where clause to the select section. In ExisitingInterests there is a selected bool variable and I only want those that are true.
This will enable me to only add those ones that have been ticked to the database.