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(开发者_Python百科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?
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
The concept your talking about is Method Chaining
x0n is correct that is a concept used in a Fluent Interface.
精彩评论