O'Reilly logo

Microsoft Visual Studio LightSwitch Business Application Development by Jayaram Krishnaswamy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing custom queries using code

The Query Designer in VSLS can do excellent filtering and sorting, but with some limitations, and it can also work with parameters. However, it has no means to support choosing certain columns, use aggregate functions, use other clauses such as group by, and any other logic not handled by the GUI. However, Query Designer code can be further fine tuned using custom code.

In the following section, we look at a number of queries written using codes. Queries in MSLS as described in earlier chapter depend on LINQ. LINQ queries are not the same as SQL queries although there is some resemblance especially when used with relational data.

A simple query with code

This example is very simple and can even be implemented in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required