|
-
Jun 24th, 2009, 07:05 AM
#1
Thread Starter
Frenzied Member
Lambda expression question
Hi!
I have a List<SearchCriteria> variable which basically store a list of searchitems. Each item has a Value property which is a string.
Now when I want to use this list to search, I need to set certain values, for example I want to show only used cars, I have a value for this. I tried to write this lambda expression to do this but I got error "cannot implicitly convert type string to bool
Code:
this.CarsSearchCriteria.Where(n => n.CriteriaId == SearchCriterias.IsUsed).First(m => m.Value = m_ShowUsedCars.ToString());
To me, this lambda is pretty straight forward. I look up the ceiteria item called IsUsed, and set the value to a local member on my form. But some how it doesnt work. What am I doing wrong? Perhaps there is a better way to do this?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|