What is so scary about DLINQ?
I read an interesting piece by Jon Galloway titled "LINQ looks good, but DLINQ scares me", which was intriguing from the outset.
Why is DLINQ scary I wondered?
All manner of visions came to mind, I admit.
On a surface level, his concerns were mostly centered around code maintainability.
But looking deeper into code sample, I discovered something truly frightening.
Take a close look here and see if you can find it:
DLINQ - Simple Select example
// DataContext takes a connection string
DataContext db = new DataContext("c:\\northwind\\northwnd.mdf");
// Get a typed table to run queries
Table<Customer> Customers = db.GetTable<Customer>();
// Query for customers from London
var q =
from c in Customers
where c.City == "London"
select c;
foreach (var cust in q)
Console.WriteLine("id = {0}, City = {1}", cust.CustomerID, cust.City);
DataContext db = new DataContext("c:\\northwind\\northwnd.mdf");
// Get a typed table to run queries
Table<Customer> Customers = db.GetTable<Customer>();
// Query for customers from London
var q =
from c in Customers
where c.City == "London"
select c;
foreach (var cust in q)
Console.WriteLine("id = {0}, City = {1}", cust.CustomerID, cust.City);
Next →
← Previous
My book "Choose Your First Product" is available now. It gives you 4 easy steps to find and validate a humble product idea.