Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
context bd=new context();

var c= bd.table1.join(table2,i=>i.key1,j=>j.key1,(i,j)=>new{i.a ,i.b ,i.c ,j.x ,j.y , j.z});
fx1(c);



public void fx1(?????)
{
.......
......
}


what would be the parameter type???
Posted
Comments
Matej Hlatky 7-Mar-13 2:43am    
That would be unfortunately auto generated Anonymous Type.
scorpzonex 7-Mar-13 3:18am    
but is there any other way to do it? like using ToList() or IQueryble() or anything else?
Matej Hlatky 7-Mar-13 5:29am    
You can create your own type and return IQueryable(Of ThatType).
johannesnestler 7-Mar-13 5:57am    
If nothing helps don't project into a anonymous type, create a "helper-type" or just use a "general" type object/IEnumerable/IQueryable and reflect the properties in the function.
scorpzonex 7-Mar-13 7:58am    
i have table1 type object and table2 type object, how do i project a join query to {table1,table2} type? please explain or give an example.

1 solution

You can pass the lambda expression to the function.


public void fx(Expression<func><tinputclasstype,>> expression)
{
.........
............
}

let the function run the LINQ
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900