Introducing Radical.sh

Forget Code launches a powerful code generator for building API's

LINQ - Joins in C#

Example:
  1. using System;
  2. using System.Linq;
  3. using System.Xml.Linq;
  4.  
  5. namespace ForgetCode
  6. {
  7. public class MainClass
  8. {
  9. public static void Main()
  10. {
  11. dat customers = new dat(@"c:\data.mdf");
  12. dat2 distributors = new dat2(@"c:\data.mdf");
  13.  
  14. var innerJoinQuery =
  15. from cust in customers
  16. join dist in distributors on cust.City equals dist.City
  17. select new { CustomerName = cust.Name, DistributorName = dist.Name };
  18. }
  19. }
  20. }