Click here to Skip to main content
15,886,963 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How we can use two or more queries in a linq statement.
Posted
Updated 10-Aug-10 2:27am
v3
Comments
LittleYellowBird 10-Aug-10 6:31am    
Hi, just to let you know, there is no need to use all capitals in your title, in fact it looks like shouting and puts people off. :)
Svetlin Panayotov 10-Aug-10 7:36am    
Can you provide a bit more detailed explanation of what exactly you're trying to achieve?
R. Giskard Reventlov 10-Aug-10 8:38am    
Have you tried searching for LINQ tutorials of which there are a myriad to be found through Google?

Hi,

If i understood your statement properly, then i am thinking that you want to perform two different actions such as projections and Ordering.

For instance - I need to get all the customers and then i need to sort based on Company name.

Then

LINQ Query -

context.Customers.Select(c => c).OrderBy(c => c.CompanyName).ToList();


Regards,
-Vinayak
 
Share this answer
 
This statement does the equivalent of AND function in the where clause of a query


C#
query = from b in query
select b;

query = query.where(col => col.Title.Contains(title));
query = query.where(col => col.Author.Contains(author)
 
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