Monday, September 12, 2011

Linq: Fluent Syntax VS Query Syntax

Fluent Syntax:

names.Where (n => n.Contains ("a")) // Privately scoped n
.OrderBy (n => n.Length) // Privately scoped n
.Select (n => n.ToUpper()) // Privately scoped n

Query Syntax :

from n in names // n is our range variable
where n.Contains ("a") // n = directly from the array
orderby n.Length // n = subsequent to being filtered
select n.ToUpper() // n = subsequent to being sorted

--Large personal choice

1. Fluent Syntax has more operators than that of Query Syntax
2. When using join , better with QuerySyntax

1 Comments:

Blogger Unknown said...

Work Sheets for your small kids visit http://www.kidsfront.com/worksheets.html

12:23 AM  

Post a Comment

<< Home