I came across this piece of source code and I’ve never seen C# code like this before.
Can someone tell me what it’s doing and where I can read more about the technique ?
<%= Foo.Bar()
.DoSomething(1)
.DoSomething(2)
.DoSomething(3)
.DoSomethingElse("Apples")
%>
(EDIT: As some answers have mentioned this: I’m not interested in the signicance of the angle-bracket-percentage parts of the quote code, I only left them in to make it clear I had seen the code in the content of a ASP.Net page. Apologies if this has led to any confusion)
That’s an example of method chaining