When is someone going to set up our Extension Method library?

The first method that should go in there is this one: very clever idea, and needed it only moments ago. Nothing revolutionary, but he’s right – almost every time you need to use String.Format, it’s after you’re halfway through writing a string…

You get to do things like this:

“Some long string la la la ooh {0} really should be a template”.FormatWith(this);

 

Click Here for the implementation: Format As Extension method

Advertisements

2 Responses to “When is someone going to set up our Extension Method library?”

  1. Alex Says:

    I suggest that, when appropriate, we have a folder (i.e., a namespace) called Extension at project level, and we can put one or more static classes there. That way, we know, by looking at the namespaces we include in code, where those extension methods in code come from. I will set up one for Hsi.Extension, and start putting some basic ones, like the string format.

  2. Nathan Says:

    Thanks Alex. Let’s use something like Hsi.Code.Extensions, so that we can reserver Hsi.Extensions for when we build end user extensibility points into our products 🙂


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: