What is the correct way to chain methods in .Net
In .Net, you can chain methods returning a value or by using a void. Is one of them the "right way"? So you could say 1) Foo myFoo = new Foo(); myfoo.Bars = myBars.DoSomethingCool(x) .DoSomethingElse(y) .AndSomethingElse(z); public static IList<IBar> DoSomethingCool(this IList<IBar> source, object x) { IList<IBar> result = //some fn(source) return result; } In this case, all 3 extension methods need to return IList (the type for myFoo.Bars) or it could also be written as 2) myBars.DoSomethingCool(x) .DoSomethingElse(y) .AndSomethingElse(z); public static void DoSomethingCool(this IList<IBar>