Skip to main content

What’s New in Microsoft LightSwitch Beta 2



The LightSwitch team has been working hard over the past few months making improvements for the Beta 2 release. Many of the improvements were based on feedback from our Beta 1 customers, including fixes for customer-reported bugs – thank you!

The full list of changes and improvements is far too big to include here - you can discover them by reading the documentation, following the team blog, and through building your own applications. The following are some of the major or more important new features:

Publish to Windows Azure

LightSwitch Beta 2 now includes the ability to publish applications to Windows Azure, fulfilling the promise of support for cloud computing.

You can use the Publish wizard to easily deploy desktop or browser applications to Windows Azure, including the ability to publish the application’s database to SQL Azure.

Improved Run Time and Design Time Performance

Performance in LightSwitch has been improved dramatically in a number of areas, including faster application startup at run time, a faster F5/build experience and faster project creation and loading.

Under the covers, performance improvements have also been made for the data load/save pipeline, calculated fields, and much more.

End-user Application Enhancements

End-users of your application will also see an improved user interface in Beta 2, including a new auto-complete control, better keyboard navigation, and an improved end-user experience for long-running operations.

Especially noticeable are the improvements to the grid, which now provides a familiar user experience similar to that of Excel or Access.

Static Spans

LightSwitch Beta 2 supports static spans, that is, the ability to include or exclude related data when executing a query. For example, an Orders entity might have a relationship to other entities such as a Customer entity. Without static spans, a separate round-trip to the server was required for each related entity for each row returned by the query, resulting in sluggish performance.

With static spans, LightSwitch is now able to return all data for a row with a single round-trip, essentially issuing a single query across multiple entities. LightSwitch analyzes the query and supplies smart default behavior, including or excluding data as needed. You can override the default behavior as needed via the Manage Included Data link from the Query designer.

Declarative Unique Constraints

Entity fields in Beta 2 can now be specified as unique. Select an entity field in Entity Designer, and look for the “Include in Unique Index” checkbox in the Properties window. Marking a field as unique ensures that an appropriate validation rule is automatically generated in the database.

A set of fields can also be specified as unique. This is useful for modeling many-to-many mapping tables, for example the combination of Order and Product on an OrderDetails table.

Permission Elevation in Server Code

This feature allows you to restrict permission to entities when they are manipulated through the UI, but still allow updates via a process that is run on the end-user’s behalf on the server. For example, the end-user shouldn't have access to update a Customer's credit limit, but as part of saving orders, a new credit limit may be calculated based on volume of business.  This is accomplished via the AddPermissions() and RemovePermissions() methods of the User class.

[Visual Basic]
Using Application.User.AddPermissions(Permissions.OrderEntry, Permissions.Administrator)
    ' Do something
End Using


[C#]
using (Application.User.AddPermissions(Permissions.OrderEntry, Permissions.Administrator))
{
    // Do something
}


Authorize All Authenticated Windows Users

The Project properties UI now provides the ability to allow any Windows user to be authenticated in a LightSwitch application while still using the LightSwitch authorization subsystem for determining user permissions for specific users.

Previously when Windows authorization was selected in a LightSwitch app, you needed to add the Windows users who are allowed to use the application into the User Administration screen of the running application. This was cumbersome in installations where there are a large number of Windows users and wanted to open the app up to all Windows users.

Screen Designer Enhancements

The Screen designer in Beta 2 has numerous improvements in response to customer feedback, including new and more flexible layout controls that afford developers greater control over the sizing and placement of UI elements.

Support for Custom Data Source Queries

When a reference is added to a WCF RIA Service implementation, parameterized queriesin a custom WCF RIA Service that return a single or collection (IQueryable/IEnumerable) of an entity type will now be imported into LightSwitch. In Beta1, LightSwitch only supported a single parameter-less default query for each entity type.

 

For additional information please see the LightSwitch Beta 2 Readme.