As far as I know, C# doesn't support this. Were they ever considered during the design of the language? Is it conceivable that they could appear in a future version of the language?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
Fluent interfaces are easily supported in C# by using
In Linq, extension methods are used to accomplish the same thing. Extension methods over
Cascades, as described by the page at the link you provided, seem to be merely a subtle refinement of an ordinary Fluent Interface where
Does C# support this? No, not exactly. But you can still write the following equivalent code:
and it is only slightly more verbose (and arguably easier to read).
As to the question, "Were they ever considered for C#," you would have to ask Anders Hejlsberg or Eric Lippert about that. My guess is that they view it as syntactic sugar, which in fact it is.