Reputation: 13
I plan to ask another question on Stackoverflow but want to use the correct term. In recent years many APIs have been designed to support the following usage where a common type is returned.
var query= myList.Where(p=>p.X == "abc")
.Where(p=>p.BirthDate.Year == 1999)
.Where(p=>p.Y == 123 )
.Where(p=>p.Z == DateTime.Now );
What is the accepted software engineering term for this API style?
Upvotes: 1
Views: 142
Reputation: 797
The concept your talking about is Method Chaining
x0n is correct that is a concept used in a Fluent Interface.
Upvotes: 1
Reputation: 52430
This is typically known as a "Fluent" interface, where methods on an instance return the instance itself, allowing chaining like your example.
http://en.wikipedia.org/wiki/Fluent_interface
Upvotes: 5