I will use the previous classes http://marisolca.blogspot.com/2015/09/linq-iv-example-of-queries.html
Left outer join
Left outer join is a join in which each element of the first collection is returned, regardless of whether it has any correlated elements in the second collection.In LINQ we can use it to perform a left outer join by calling the DefaultEmpty<TSource> method on the result of a group join
DefaultEmpty<TSource> method: Returns the elements of the specify sequence or the type parameter's default value in a singleton collection if the sequence is empty.
For example.
Add a new employee and delete Country code of Antonia
The notion of left or right is relative.If we are interested in getting a match which appeared all people, even thought they did not have an associated country, we could change the order of the operands of the match in the previous query.
it deleted country code of Sole and was added it to Antonia
Symmetrical external match
LET clause
In a query expression, it is sometimes useful to store the result of sub-expression in order to use it in subsequent clauses.We can do this with LET keyword, which creates a new range variable and initializes it with the result of the expression us supply.
Other examples:
We want to get people whose age is greater than or equal that middle ages of the group. If we use LET key, it will be done with a single query.









No hay comentarios:
Publicar un comentario