Some Object Relational Mapping (ORM) frameworks (such as LLBLGen) allow you to specify "predicate" parameters to the query methods, such as (simplified a bit):
var entities = adapter.FetchEntities(EntityType.Employee,
EmployeeFields.Salary > 50000);
How does that 2nd parameter work syntactically in C#? It kind of looks like a lambda expression, but it doesn't have the parameter part or the "=>". What is it? May need Jon Skeet for this one.
If you overloaded the ">
" operator to return some kind of predicate object on your special "SuperDatabaseMapField
" type, you could do such things.
That said, it seems vastly inferior in every way to taking a lambda expression instead (and parsing an expression tree if you have to.)