Top "Extension-methods" questions

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

Razor HtmlHelper Extensions (or other namespaces for views) Not Found

Dunno if this was happening in the PR or Beta, but if I create an extension method on HtmlHelper, it …

asp.net-mvc-3 extension-methods razor html-helper
Mocking Extension Methods with Moq

I have a preexisting Interface... public interface ISomeInterface { void SomeMethod(); } and I've extended this intreface using a mixin... public static …

c# unit-testing mocking extension-methods moq
AddRange to a Collection

A coworker asked me today how to add a range to a collection. He has a class that inherits from …

c# collections c#-3.0 extension-methods
Static extension methods

Is there any way I can add a static extension method to a class. specifically I want to overload Boolean.…

c# extension-methods
The operation cannot be completed because the DbContext has been disposed error

I'm new to EF and I'm trying to use an extension method which converts from my Database type User to …

c# entity-framework extension-methods
Java equivalent to C# extension methods

I am looking to implement a functionality in a list of object as I would in C# using an extension …

java extension-methods
How to extend C# built-in types, like String?

Greetings everyone... I need to Trim a String. But I want to remove all the repeated blank spaces within the …

c# string extension-methods trim
Swift extension example

I was originally wanting to know how to make something like this UIColor.myCustomGreen so that I could define my …

swift extension-methods
Can I "multiply" a string (in C#)?

Suppose I have a string, for example, string snip = "</li></ul>"; I want to basically write …

c# string extension-methods
How to add new methods to an existing type in Go?

I want to add a convenience util method on to gorilla/mux Route and Router types: package util import( "net/…

go extension-methods