How to use COUNT after a WHERE clause in Microsoft Ligthswitch?

A lot of times I use COUNT to control certain user interaction and rights manipulation.  Below is an example of a running LINQ code that determines the user’s screen using COUNT.

mstuserscreens.where(function(r) r.user.id=2).count

The problem with the above code is that it will not compile in Microsoft Lightswitch.  See below.

The solution is to add an EXECUTE clause after the WHERE and before COUNT.

You know what, the solution is simple but it took me a while to figure this out.

If you find this blog helpful, you can make the donation by clicking the Paypal button below.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s