I am taking the input from user and store in variable. then I am selecting the data from database using LINQ to do that I have to perform a join condition and the property of that join should change according to what user enter if user select location then it should be e.Location and if he select department it should be e.department . the join condition both the side is a INT and while storing the data in variable I am getting the value in string, for example user select location so the variable is string variable , so on join it should be changed to INT to perform proper join. In my model class I have 4 property location, department, designation, Etiolation. from front end user select any of this so it should do store in variable then it fetch value from database I have written the below query. it should join with other table to fetch value so this is a case, if user select any of this it should be join with other table for that I want to use variable to join the table .
before making the value change according to user select .
var param = form["Category"];
var query = (from e in table1 join c in table2 on e.location equals c.Id select e);
doing some thing with the query data
and how I want it to be ,
var param = form["Category"];
var query = (from e in table1 join c in table2 on e.param equals c.Id select e);