Getting Started With LightSwitch and OpenAccess

Monday, September 20, 2010 by Joshua Holt | Comments 6

Over the next few blogs we will look at working with LightSwitch and OpenAccess, but first i would like to lay a little ground work. :)

What is LightSwitch?

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). 

What Do I Need?

To get started you will need to go download the LightSwitch Beta, as well a copy of OpenAccess. The LightSwitch install will add a new project template to the “New Project” dialog in Visual Studio.  

How can OpenAccess Work With It?

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. 

Lets Get Started!

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:

SNAGHTML42fa0b7

My Solution now looks like this:

image

Next create a domain model.   Here is the model I will be using for the upcoming blogs:

image

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!

Part 1

Part 2

Part 3

6 Comments

  • Ben Hayat 22 Sep 2010
    Hey Josh, great to see you guys jumping on LS. Something that I've been nagging at Nikolay to look into. I think LS is going to be a great tool to bring new developers to Silverlight and Telerik Tools for SL. So, your blogs are to be appreciated by many to see how Telerik tools will shine in LS.

    At this early stage where some may not have OpenAccess or are not willing to install it, will prevent them to get started. My humble opinion is to remove that variable for the time being, and just use the std SQL Express and EF (if you need to) and focus on showing Telerik SL tools within LS. Then in the future you can begin to introduce OA as an alternative.

    Unless, I missed your intention and you actually wanted to showcase OA.
    ..Ben
  • Luc 23 Sep 2010
    Yes, I was expecting a blog post about the upcomming support for LightSwitch,
    and especially "Telerik Extensions for LightSwitch" and how Telerik is planning how to use RadControls inside this LightSwitch Extension.

    Ragards,
    Luc
  • Joshua Holt 25 Sep 2010
    Hi Guys,
    Thank you for the feedback.  This is definitely not the only thing you will hear from us about LS.  I mainly focus on OpenAccess, and these blogs came about from me working with the two.  My goal was indeed to show how OA could easily be used with LS.  We will be posting more about using our controls with LS very soon, so stay tuned!
    Regards,
    Josh
  • Ben Hayat 27 Sep 2010
    Josh, keep me posted about your progress with Telerik controls and LS and I'll echo those within LS community. I spoke to Todd about this over the weekend as well too.

    Josh, could you please send me an email, so I can tell you a couple of other things as well?
    Thanks!
    ..Ben
  • zxl 28 Oct 2010
    After I have read the post, my problem is Where OA(OpenAccess) is installed ?  OA is installed With  VS2010 or LS Beta1  ?
  • Joshua Holt 28 Oct 2010
    Hi zxl,
    OpenAccess is a third party ORM from Telerik.  You can read more about on this page, and you can download a trial on this page.  Please let me know if you have any other questions.
    -Josh

Add comment

  1. Formatting options
       
     
     
     
     
       
  2. (optional, emails won't be shown on public pages)
  3. (optional)