Posts Tagged ‘extension methods’

Forcing Extension Methods to Be Used

tobj-067 I received the following question:

Is it possible to force a namespace to be included so that the extension methods in it will be used in it instead of the methods in the main class?

I have to admit, I had to go and do a little research on this, but once I did, I found out that the assumption behind the question is inaccurate.

Read the rest of this entry »

Extension Methods in CSharp

Have you ever wanted to add a method to a sealed class, like string?  Or, have you ever wished you could provide more than a signature for a method in an interface?

Well now you can.  Today we are going to look at extension methods which will allow you to do both of these. Read the rest of this entry »