Search code examples
wcf-ria-servicesvisual-studio-lightswitchlightswitch-2013

How to use Open RIA Services packages from NuGet


I am an experienced developer trying to add a WCF RIA Services class library to a LightSwitch 2013 desktop app and I'm a little confused on how to get started...

I know that Microsoft's WCF RIA Services will no longer be updated, it has been open-sourced and a newer version called Open RIA Services is available. I've never used either one before, and have been scouring these resources to no avail:

The problem is, there is very little current documentation or tutorials or walkthroughs or even blog posts about Open RIA Services (or the WCF version, for that matter).

Am I just stuck in limbo between frameworks? Should I use one over another for some reason?

My main question is: Which NuGet package(s) do I get for a LightSwitch 2013 desktop app? I plan to use it to access a SQL Server backend, replacing LightSwitch's built-in data access (for performance reasons mainly).


Solution

  • You don't actually need to use Open RIA Services to be able to create a RIA Service in VS 2013. And I'm not even sure that LightSwitch would recognise the services if they're in a different namespace than the original anyway. But LightSwitch does still allow you to write RIA services that will be recognised by the "Add Data Source" wizard, even though we appear to be being discouraged from creating them, in favor of using OData instead.

    While the wizard and any designer support for RIA Services was removed in VS 2013, all you really need to create one is a class that inherits from DomainService (just add a reference to System.ServiceModel.DomainServices.Server), plus the usual things that LightSwitch needs, such as a default query etc.

    Any article written about using RIA Services in LightSwitch still applies, apart from the inability to create the service through the wizard.

    I'm still actively creating and consuming RIA Services created in this way in my current LightSwitch applications. It's a great way to flatten object graphs for display purposes, or for combining/aggregating objects for reporting etc.