LINQ THINK

Posted by: Peter Brombergs UnBlog, on 13 Aug 2010 | View original | Bookmarked: 0 time(s)

The more I use LINQ, the more I run into legacy code that can easily be improved. The nice thing about LINQ is that it can make your code more elegant and easier to understand, as well as, in most cases, more efficient. Lets take a simple  example. Here Ive extracted some legacy code in the form of a method that tells you if a given string Key is present in a string array. First, the OLD way: //"OLD" way: static bool IsKeyInArray(string[] items, string key) { if (items == null) return false; if...

Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: XLinq | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 697 | Hits: 52

Similar Posts

  • LinqPad, Linq Queries and IEnumerable more
  • Writing LINQ providers easily and elegantly (LinqExtender 3.0) more
  • Linqpad - an excellent free utility for developing and testing LINQ Expressions more
  • Just interviewed Atif Aziz more
  • Oredev Wrap-Up more
  • Linking Zune media items with LinQ, Part 1 (Matt Gertz) more
  • StackOverflow DevDays in London more
  • Lightweight Linq Parser more
  • What’s Wrong With This Code (#23) more
  • Migrated from Community Server to DasBlog more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD