| When Linq and ref Parameters Meet | Posted on Tuesday, April 01, 2008 at 7:17 AM | It's fair to say that I'm a pretty heavy user of Linq. You'll find uses of it scattered across my code, from the obvious (using DLinq to query a database) to the slightly more exotic (writing queries over collections obtained from classes in System.Reflection). Linq often allows you to express a problem very neatly, resulting in compact, readable code. It also factors out the application of operations and leaves you to worry about the operations themselves, likely decreasing bugs.
Fixing A Bug
Today I ran across some code that took a parameter, then used it in a Linq query. Omitting the clutter, it looked something like this:
public void Lookup(string URL, ref int ID, ref int Status)
{
// ...stuff...
var Result = from D in DB.Datas
where D.URL == URL
select D;
// ...more stuff...
}
Read More |
| C# 3.0 Part 4: Linq | Posted on Wednesday, December 12, 2007 at 5:12 AM | The final part of our C# 3.0 series is about Linq - Language Integrated Query.
Learn:
- What declarative programming is
- How to write Linq queries
- How to use ordering, joins, groups and query continuations
- What DLinq and XLinq are
Read it now!
|
| Inside PH: C# 3.0 and Linq | Posted on Monday, December 10, 2007 at 6:01 AM | This morning I started working on a new library for a new feature we'll be rolling out in the not too distant future. It is the first production code that we're developing at PH using Visual Studio 2008, which brings us C# 3.0 and Linq.
Just one morning into it, it already feels like a vast improvement. It took all of ten minutes to get the DLinq classes generated in Visual Studio; it would have taken under five if it hadn't been my first time doing it and working it out as I went. Then they were ready to use, which was also trivial. No more writing SQL or stored procedures or calling methods on a data reader to get the data out: just instantiate the DataContext (which represents the database), write the query, and it's done.
Read More |
|
Subscribe
RSS Feed
More Tags
.NET C C# C# 3.0 C++ Embedded engineering service eveh3d firmware Hardware Linux Made-In-China offshore Operating System Outsource Perl product development Programming R&D Software
Help
Check out the Blog FAQ.
|