Ok, I have decided to make the much needed leap into the Wonderful World of WCF RIA Services and how it can be leveraged to help “power-up” my lightswitch application.
I love how you can get creative with multiple entities and output a custom aggregation. More so, I love how you can take calculated fields and make them queryable (is that word?) and sortable, with an added bonus of a performance gain.
To add, I found this lovely Nuget Package, TheLightSwitchToolbox.RiaServices.Server, by Paul Vanbladel to help ease the pain in turning a class into a full internal Ria Service.
However, what I have not yet found is an exampled means in which to access server-level name spaces (lets say System.Device.Location); being invoked client side, and returning a calculated value back to the client. I can certainly do this by accessing, at server level, the table inserted method through a proxy record, and then letting the client have its way with it before deleting the record. However, there must be a more elegant way in doing this via a WCF RIA Service.
As I am still on the low end of the learning curve regarding WCF RIA Services, any helpful pointers would be most welcomed.
With much thanks in advance,
I have an entity named ContentItem which contains a type specifier (FK to ItemType tabel) , and a name as string.
Each entity can have a reference to another ContentItem so I made a 0..1 to n relation to itself.
The model is displayed at the top of the first image in the picture below.
There needs to be a business rule that a ContentItem can only be linked to ItemTypes of another type. E.g. ItemType 1 to ItemType 2.
So first I made a editable grid screen editing itemtypes.
Then I design a grid / details screen where in a dropdown the user needs to select an item to be linked.
The screen looks as the second image in the picture below
In order to have the dropdown show only the linked Items I made a query as a child from ContentItems, call it ItemsAvailableToLink and retrieves as parameter the selected ItemType in the screen.
In the Preprocess Query I change the query to the following:
partial void ItemsAvailableToLink_PreprocessQuery(int? ItemTypeId, ref IQueryable query)
if (ItemTypeId != null)
query = query.Where(x => x.ItemType.ItemTypeId != (int)ItemTypeId);
query = query.Where(x => x.LinkedItem.ItemId == null);
HTML Stuff goes here...
I am trying to consume Adobe's Echosign API into my lightswitch application. It's webservice is a SOAP Web Service, whereby I can make HTTP requests to their SOAP gateway and receive synchronous responses.
I was successful in integrating it into my development environment, by using Lightswitch's server side 'Service Reference', which was able to retrieve all the various classes from their WSDL url.
However, once I publish into a IIS environment, my application fails to communicate with their web service. Do I need to build this via a WCF RIA service?
Any help would be most welcomed.