I am looking for the LAMBDA expression code that would do the equivalent of:
int ddl_emp = dropdownlist1.SelectedItem.Value;
myDataContext dc = new myDataContext();
var queryEmployees = from emp in dc.EMPLOYEES
from dept in dc.DEPARTMENT
where emp.empID == dc.empID
// if (ddl_emp != 0) where emp.empID == ddl_emp THIS IS WHERE I NEED THE RELATED LAMBDA EXP.
select new (emp.Fname, Dept.Department)
CSharper7
Member
2 Points
11 Posts
If statement for WHERE clause
May 09, 2012 01:34 PM|LINK
Hi All
I am looking for the LAMBDA expression code that would do the equivalent of:
int ddl_emp = dropdownlist1.SelectedItem.Value; myDataContext dc = new myDataContext(); var queryEmployees = from emp in dc.EMPLOYEES from dept in dc.DEPARTMENT where emp.empID == dc.empID // if (ddl_emp != 0) where emp.empID == ddl_emp THIS IS WHERE I NEED THE RELATED LAMBDA EXP. select new (emp.Fname, Dept.Department)Any chelp woulb be much appreciated
thanks!