How to use LINQ inner join clause based on a simple key

Web developers use LINQ join clause when he/she wants to associate elements from different source sequences that have no direct relationship in the object model. For example, an electronic devices distributor might have a list of suppliers of a certain product, and a list of buyers. A join clause can be used, for example, to create a list of the suppliers and buyers of that product who are all in the same specified region

A join clause takes two source sequences as input. The elements in each sequence must either be or contain a property that can be compared to a corresponding property in the other sequence. The join clause compares the specified keys for equality by using the special equals keyword. All joins performed by the join clause are equijoins. The shape of the output of a join clause depends on the specific type of join Web developers are performing.

When Web developers use inner join they have to expects a result set based on two collection in which each element of the first collection appears one time for every matching element in the second collection. If an element in the first collection has no matching elements, it does not appear in the result set.

The following example creates two collections those contain objects of two user-defined types, Person and Book. The query uses the join clause to match Person objects with Book objects whose Author is that Person.