@korchev thanks for your reply. In LightSwitch queries could be modeled on top of entities having Filters, Sorts and Parameters. At design time a filter is added by selecting the property, comparison operator (eq, gt, contains, etc), the ‘value type’ and the value.
The value type can be either Literal, Parameter, Property, or Global.
- Literal value is hard-coded
- Parameter value generates the getter method with a parameter arg (as-in TenanID above)
- Property value compares one property to another (ie: Customer.ModifiedOn >= Customer.CreatedOn)
- Global is a seldom used option similar to Parameter but global in scope.
On the server side, three ‘queries’ are generated for every entity. All(), Single(id), SingleOrDefault(). Queries are composable so every query including singletons are composed on top of the All() query.
All modeled queries take a filter expression of the following type which evaluates to a boolean.
Which is interpreted in the query method like so .Where(customer.tenantID == myTenantParam);
When you design a page based on a query you can optionally bind the parameter value to screen properties such as an input box value.
thanks for listening