LightSwitch is a new Microsoft tool enabling developers, and power users, to create multi-tier applications, quickly and easily. Those of you familiar with Microsoft Access will find it gives you even more power to create application that are easy to maintain, and easy to distribute. Since the applications made with LightSwitch are Silverlight based, they are easily deployed in browser (3-tier), out of browser(3-tier), or directly to the desktop(2-tier).
LightSwitch allows developers to connect to a variety of data sources. In the beta, developers can create a new database using the LightSwitch table wizards, connect to an existing database, SharePoint lists, or load data exposed through RIA Services. The latter option is where OpenAccess comes into play. Using an OpenAccess Domain Service, we can expose an OpenAccess Domain Model to LightSwitch.
For this example, I will be building a sample project tracker to track clients, projects, employees, and timesheets. We have many resources available (video, blog, documentation) which show how to create a model using the Visual Designer; so I won’t be focusing on that aspect in this blog.
First thing we need to do is create a solution, and add a class library to it. The class library will hold our model, so add a new “OpenAccess Domain Model”. I will build this using forward mapping, so I selected “Empty Domain Model” from the OpenAccess dialog:
My Solution now looks like this:
Next create a domain model. Here is the model I will be using for the upcoming blogs:
Feel free to ask any questions, if you run into issues recreating it. :)
In the next blog we will look at setting up an OpenAccess Domain Service that can be used by LightSwitch!
Subscribe to be the first to get our expert-written articles and tutorials for developers!