Last post Aug 31, 2006 02:24 PM by phuff
Aug 31, 2006 01:29 AM|gahayden|LINK
You already know this but it doesn't hurt to say it again - this is exceptional work and should be highly praised and rewarded.
Just so we don't head off in the wrong direction can you confirm if the last line in the following static method (generated by BLINQ against the Northwind DB )
is a abstraction of LINQ created by BLINQ or just a form of LINQ we haven't seen? It certainly appears different from any of the previous LINQ code we been looking at.
public static IQueryable<Order> GetOrdersByCustomer(String
Northwind db =
return db.Customers.Where(x=>x.CustomerID == CustomerID).SelectMany(x=>x.Orders);
It is certainly appears far different from LINQ code such as this:
DataList1.DataSource = from p in db.Customers where p.CustomerID == CustomerID select p.Orders;
So is it an abstraction or is it just a different form?
Aug 31, 2006 02:24 PM|phuff|LINK
Thanks, Greg- I'm glad you like it.
LINQ supports two different syntaxes for query statements. The query syntax is the one you show, and typically reads more like a SQL command:
from p in db.Customers
where p.CustomerID == CustomerID
The explicit syntax reads more like code:
db.Customers.Where(x=>x.CustomerID == CustomerID)
The two are equivalent. I happen to like the explicit syntax better, so Blinq uses that. [:)]