Top "Extension-methods" questions

An extension method is a language feature of some languages, such as Swift, Visual Basic.

Will the dynamic keyword in C#4 support extension methods?

I'm listening to a talk about C#4's dynamic keyword and I'm wondering... Will this feature be orthogonal to other .…

c# dynamic extension-methods c#-4.0
What is the performance of the Last() extension method for List<T>?

I really like Last() and would use it all the time for List<T>s. But since it …

c# .net linq extension-methods
Extension methods in a class library project

I've implemented some extension methods and put those in separate Class Library project. Imagine I have a simple extension method …

c# asp.net extension-methods class-library
Where do I put my extension method?

A senior member here gave me this code: public static string Truncate(this string value, int maxChars) { return value.Length &…

c# .net extension-methods
C# naming convention for extension methods for interface

I typically name my C# interfaces as IThing. I'm creating an extension method class for IThing, but I don't know …

.net interface naming-conventions extension-methods
Extension Methods vs Instance Methods vs Static Class

I'm a little bit confused about the different ways to use methods to interact with objects in C#, particularly the …

c# extension-methods poco static-classes instance-methods
Is it appropriate to extend Control to provide consistently safe Invoke/BeginInvoke functionality?

In the course of my maintenance for an older application that badly violated the cross-thread update rules in winforms, I …

c# winforms controls extension-methods invoke
How to call a generic extension method with reflection?

I wrote the extension method GenericExtension. Now I want to call the extension method Extension. But the value of methodInfo …

c# generics extension-methods methodinfo
What are Extension Methods?

What are extension methods in .NET? EDIT: I have posted a follow up question at Usage of Extension Methods

.net extension-methods
Is there a performance hit for creating Extension methods that operate off the type 'object'?

I have a set of extension methods that I regularly use for various UI tasks. I typically define them to …

c# extension-methods