Top "Extension-methods" questions

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

ASP.NET MVC @helper syntax vs Html Helper Extension methods

I need to create custom html helper method. As far as I know there are two ways: Use @helper razor …

c# asp.net-mvc extension-methods razor-declarative-helpers
C# extension method as an interface implementation

I was wondering if a C# extension method of some class could act as an implementation of interface? What do …

c# interface extension-methods multiple-inheritance
Error: Extension methods must be defined in a top level static class (CS1109)

I'm trying to make a countdown program, which I can start and stop and set the value of the countdown …

c# .net extension-methods static-classes
How can I get an extension method to change the original object?

I want to be able to write extension methods so that I can say: lines.ForceSpaceGroupsToBeTabs(); instead of: lines = lines.…

c# generics object extension-methods
Python extension methods

OK, in C# we have something like: public static string Destroy(this string s) { return ""; } So basically, when you have …

python extension-methods
Can There Be Private Extension Methods?

Let's say I have a need for a simple private helper method, and intuitively in the code it would make …

c# extension-methods encapsulation
Raising C# events with an extension method - is it bad?

We're all familiar with the horror that is C# event declaration. To ensure thread-safety, the standard is to write something …

c# .net events event-handling extension-methods
Extension methods in Python

Does Python have extension methods like C#? Is it possible to call a method like: MyRandomMethod() on existing types like …

python function extension-methods
Scala equivalent of C#’s extension methods?

In C# you can write: using System.Numerics; namespace ExtensionTest { public static class MyExtensions { public static BigInteger Square(this BigInteger …

scala extension-methods
DataRow constructor inaccessible when writing DataSet extension?

I am trying to write a couple of extensions to convert UniDataSets and UniRecords to DataSet and DataRow but I …

c# extension-methods system.data