LINQ query and lambda expressions

Posted by user329269 on Stack Overflow See other posts from Stack Overflow or by user329269
Published on 2010-04-29T20:55:26Z Indexed on 2010/04/29 20:57 UTC
Read the original article Hit count: 358

Filed under:
|

I'm trying to write a LINQ query and am having problems. I'm not sure if lambda expressions are the answer or not but I think they may be.

I have two combo boxes on my form: "State" and "Color".

I want to select Widgets from my database based on the values of these two dropdowns.

My widgets can be in one of the following states: Not Started, In Production, In Finishing, In Inventory, Sold. Widgets can have any color in the 'color' table in the database.

The 'state' combobox has selections "Not Sold," "In Production/Finishing", "Not Started," "In Production," "In Finishing," "In Inventory," "Sold." (I hope these are self-explanatory.)

The 'color' dropdown has "All Colors," and a separate item for each color in the database.

How can I create a LINQ query to select the widgets I want from the database based on the dropdowns?

© Stack Overflow or respective owner

Related posts about LINQ

Related posts about lambda-expressions