|
|
|
|
|
by wtetzner
4629 days ago
|
|
The thing that's nice about Linq is the integration. You can directly reference variables in the things you're querying, and then either fill in an instance of an existing class, or generate an anonymous object. For example: var query = from c in customers
join o in orders on c.ID equals o.ID
select new {
c.Name,
o.Product,
Address = c.MailingAddress
};
Of course, anonymous objects in C# can be a pain in the ass, since you can't usefully return them from a method. Something like Scala's structural types would solve that problem.I don't really like C# that much as a language, but I do like the Linq approach. |
|