Current area: HOME -> Blogs -> Jonathan's Blog -> Read Post

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.

I have also been enjoying the new Lambda expression syntax and type inferencing, which has saved me a few keystrokes already and makes the code somewhat more readable (provided you recognize the new syntax, of course). Once I know that this all fits into our build process smoothly, I'll probably begin moving some other projects over the Visual Studio 2008 so we can also use the new C# 3.0 features in those. Note that we won't be re-writing things just for the sake of using C# 3.0 features in them; that's probably just a reliable way to introduce new bugs, and I'd advise against that generally unless you've got really good reasons to do it.

Don't forget that PH is currently running a series on C# 3.0; the final part, on Linq, comes out this week! I plan to follow it up with an article on DLinq; I've been holding back on that until I'd got some more practical experience using it, though.

Comments
No comments posted yet.


Sponsored links

Build IT Knowledge with Current & Trusted Content
Helps Employees Develop & Hone New Technical Programming Skills. Sign Up & Get Full Access.
Check Out IT Certification Preparation Materials
Sign Up With SkillSoft & Get Access to Training Materials for Over 50 Professional Certifications.
SFTP components for .NET
Add complete SSH and SFTP support to your .NET framework application
Virtual File System SDK
Create your own file systems in Windows and .NET applications
PureCM Software Configuration Management
Version control and integrated issue tracking - powerful and easy to use. Get your FREE trial now!


Newsletter | Submit Content | About | Advertising | Awards | Contact Us | Link to us |
© 1996-2008 Community Networks Ltd All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Synchron Data - .NET development.