Show/Hide Toolbars

TMS Aurelius Documentation

Navigation: Queries

Fluent Interface

Scroll Prev Top Next More

The criteria objects you create implement a fluent interface. This means that most methods in the class will return an instance of the object itself. This is just a easier way to build your queries.


So instead of building the query like this:


  Results: TObjectList<TCustomer>;
  Criteria: TCriteria<TCustomer>;
  Filter: TCustomCriterion;
  Criteria := Manager1.Find<TCustomer>;
  Filter := Linq['Name'] = 'Mia Rosenbaum';
  Results := Criteria.List;


You can simply write it this way:


  Results: TObjectList<TCustomer>;
  Results := Manager1.Find<TCustomer>
    .Add(Linq['Name'] = 'Mia Rosenbaum')

Almost all the examples in this chapter uses the fluent interface so you can fully understand how to use it.