With extension methods: "x.Operation1(arg1).Operation2(arg2)"
==The versioning problem==
Instance methods are always preferred over extension methods, even when new instance methods replace previously-existing extension methods. However, Visual Studio gives no warning about naming conflicts. Consider this C# code:
<source lang="csharp">
class AlphabetMaker { }
static class ExtensionMethods
{
static public string GetAlphabet(this AlphabetMaker am)
{
return "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
}
}
</source>
The GetAlphabet extension method can be called in this way: