Home > Microsoft .Net Development Tips > C# Development > On Extension Methods in C# and .NET Framework 3.5
Win Development Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

C# DEVELOPMENT

On Extension Methods in C# and .NET Framework 3.5


SearchVB.com staff
09.20.2007
Rating: --- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


As Visual Studio 2008 and the .NET Framework 3.5 spend more time in the wild, developers and architects are increasingly turning to the blogosphere both to see what the new IDE has to offer and to share lessons learned from the trenches.

One software architect in the latter category is Alex Hoffman, who recently wrote five blog posts under the heading "Adventures in .NET 3.5." In each post Hoffman shares a thing or two he has learned along the way.

Adventures in the .NET Framework 3.5, Part 1 takes a look at Extension Methods, which make it easy for an object to, as it were, print itself to the console. There's also a C# code snippet to implement concatenation once the aforementioned print method has done its thing.
More on Extension Methods in Visual Studio 2008
Visual Basic team offering Extension Methods tutorials 

Adventures in the .NET Framework 3.5, Part 2 expands on the Extension Method, demonstrating how it can be used to implement an Each method. Doing so gives C# code some of the same power as Ruby Blocks.

Adventures in the .NET Framework 3.5, Part 3 shows how the new compiler can infer a collection's type. Hoffman then provides some C# code for creating a public delegate, creating an Extension Method, and applying the Concatenate and Print methods to a collection.

Adventures in the .NET Framework 3.5, Part 4 builds on the Transform method form the previous post to do even more with the resulting collection.

Adventures in the .NET Framework 3.5, Part 5 (published with the headline "CodeDomProvider -- Targeting .NET 3.5" but tagged as a continuation of the adventure) offers the C# code needed to target the .NET Framework 3.5 if one is using a CodeDomProvider for code compilation. This is necessary because, by default, the CodeDomProvider targets the .NET Framework 2.0, Hoffman points out.


Rate this Tip
To rate tips, you must be a member of SearchWinDevelopment.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
C# programming language
LINQ beyond queries: Strong-typed refection
Assembly versioning in the .NET Framework 2.0
Book excerpt: Creating graphical output using the .NET Compact Framework
Visual Studio 2008 Learning Guide: C# 3.0
Simonyi firm to address divide between domain experts and developers
Generate RSA public and private keys, export to XML
Book excerpt: Upgrading to Visual Studio 2005
Learning .NET: Tips for getting started with .NET development
Book excerpt: Code snippets in Visual Studio 2005
Choosing VB.NET or C# Learning Guide

.NET Framework 3.5 and Visual Studio 2008 development
Printing in Windows Presentation Foundation
Book excerpt: Murach's VB 2008
Mainsoft introduces .NET-to-Java translation tool
A view on VS 2008: On-line agency sees reasons to upgrade
LINQ Learning Guide: LINQ and Visual Studio 2008's new language features
Customizing Visual Studio 2008 using VS Shell
Shell Objects adds Visual Studio 2008, x64 support
How to uninstall pre-release versions of Visual Studio 2008
.NET Framework Library source code released
.NET Framework goes multicore

C# Development
Picking a .NET smart client communications technology
LINQ beyond queries: Strong-typed refection
Book excerpt: An introduction to DSL tools
Assembly versioning in the .NET Framework 2.0
Book excerpt: Creating graphical output using the .NET Compact Framework
Generate RSA public and private keys, export to XML
Book excerpt: Upgrading to Visual Studio 2005
Learning .NET: Tips for getting started with .NET development
Book excerpt: Code snippets in Visual Studio 2005
Sophisticated math add-in for Visual Studio 2005

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
C#  (SearchWinDevelopment.com)
GLib  (SearchWinDevelopment.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.

About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 2000 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts