Enable Dynamic Queries
It would be really nice if dynamic queries could be used in PreProcessQuery method. For example, if Dynamic Linq Library functionality was built into LS we could use strings instead of lambda expressions in Linq OrderBy & Where clauses.
query = query.OrderBy("LastName, FirstName DESC")
Instead of this:
query = query.OrderBy(a <= a.LastName).ThenDescendingBy(a <= a.FirstName)
There is an old unreleased Dynamic Linq Library that does this seen here:
This would allow us to easily enable server-side sort based on runtime-user interaction. For example: Allow users to sort the HTML Table Control by clicking on column headers.
There are related comments in this blog:
Bringing this a step further, it would be nice if the LS Query Designer would allow defining a sort on an optional string parameter. That way we'd not need to use PreProcessQuery since the Dynamic Linq Library can apply the sort from a tSQL-like string of comma delimited field names.
Thank you for your suggestion on improving LightSwitch. However, Visual Studio 2015 is the last release of Visual Studio that includes the LightSwitch tooling and we recommend users not begin new application development with LightSwitch. That said, we will continue to support users with existing LightSwitch applications, including critical bug fixes and security issues as per the Microsoft Support Lifecycle. Please see the blog post for more information: https://blogs.msdn.microsoft.com/lightswitch/2016/10/14/lightswitch-update/
– The Visual Studio Team
Dan R Gleason commented
I agree fully with the above suggestion. The HTML table should have the same sortable column header function as broswer based grid and it would make it so much easier to have non-lambda expressions for sorting and filtering. It makes it a lot faster when you keep the expressions as close to "plain english" format as possible so we can keep focus on the LOB requirements and not the "Bing" search hits...