C# Linq select join on select group by?

Yes, Linq to SQL does have an inner join implemented: var groupMax = from cv in db. ContactValue where cv. Contact_id == ContactID && cv.

Version cv. Version) }; var res = from cv in db. ContactValue join gm in groupMax on cv.

Version equals gm. Version where cv. Contact_id == ContactID && cv.

IsActive orderby cv. Version ascending /*for example*/ select cv.

Thank you it works I just changed join gm in groupMax on new { cv. MainId, cv. Version } equals new { gm.

MainId, gm. Version } because I need to use multiple condition join... Much better then what I was useing meanwhile : ExecuteStoreQuery(sqlQuery); – Illusion Jun 15 at 12:39.

I'm not as good at other people on here, so I can't take your query and turn it into linq from just reading it. But I do have experience doing just that locally. Best thing I can recommend is getting linqpad, and work on it from there.

Let's you easilly see the sql output so you can refine your linq as much as you need to.

1 IMHO, probably should have been a comment not an answer. – Yuck Jun 15 at 12:45.

The group clause enables you to group your results based on a key that you specify. For example you could specify that the results should be grouped by the City so that all customers from London or Paris are in individual groups. In this case, cust.

City is the key. When you end a query with a group clause, your results take the form of a list of lists. Each element in the list is an object that has a Key member and a list of elements that are grouped under that key.

When you iterate over a query that produces a sequence of groups, you must use a nested foreach loop. The outer loop iterates over each group, and the inner loop iterates over each group's members. If you must refer to the results of a group operation, you can use the into keyword to create an identifier that can be queried further.

For more information, see group clause (C# Reference).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions