SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 120 | Next

Scott Klein

"Professional LINQ"

GroupJoin(riders,
Team => Team.name,
Rider => Rider.TeamName,
(team, teamRiders) => new {Team = team.name,
riders = teamRiders.Select(rider => rider.name)});
foreach (var tar in teamsandriders)
{
listBox1.Items.Add(tar.Team);
foreach (string rider in tar.riders)
listBox1.Items.Add(" " + rider);
}
The results from this query look like this:
Yamaha
Grant Langston
Broc Hepler
Chad Reed
Honda
Andrew Short
Tommy Hahn
Davi Millsaps
Kevin Windham
Kawasaki
James Stewart
Tim Ferry
Suzuki
Ricky Carmichael
This example used an in-memory array to apply a Groupjoin, to help you understand the concept of the
operator. The same can be applied to a LINQ to SQL query:
private void cmdGroupJoin_Click(object sender, EventArgs e)
{
DataContext context = new DataContext("Initial Catalog=AdventureWorks;Integrated
Security=sspi");
Table salespeople = context.GetTable();
Table orders = context.GetTable();
var salespeopleandorders = salespeople.GroupJoin(orders,
SalesPerson => SalesPerson.


Pages:
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6