Enhancing LightSwitch applications with additional ODATA or WebAPI controllers is a pretty common task. However when you try to build a CodeFirst based controller in combination with EntityFramework 6, you will run into a lot of errors by default. Here are the steps to get this cleared and running: 1. Create a Visual Studio LightSwitch HTML project In this example […]
Today I would like to present you a simple ODATA search controller that you can use in LightSwitch (or any other ODATA consumer) to look up user accounts (and possibly other objects). When using SharePoint you will probably know the very convenient PeoplePicker. However, in LightSwitch (HTML) there is no equivalent to that. You certainly have “Person” objects/data types but […]
Following the very cool series of ODATA articles on the ASP.NET site by Mike Wasson you will see that it is possible to define actions not only on entities directly, but also (unbound) on entity sets and the service root itself. While it is fairly straightforward to implement entity set action (the same as an entity action but without the […]
I recently wrote on how you can call ODATA actions via PowerShell. However, sometimes these actions return entity types that you cannot resolve easily in PowerShell. Normally you would resort to “Execute()”, but this is neither easily doable in PowerShell. But as most usual there is another way around this. Instead of using “Execute()” to retrieve the data you rely […]
Have you ever tried to use ODATA Actions from PowerShell and realized that the Service Reference in your class library does not expose them? You can actually do it via the model’s ‘Execute()’ method. Here is a quick description on how to do it without writing too much URL style code. Let’s presume we have a model referenced in a […]
When working with ODATA sources from PowerShell via a service reference (instead of using explicit REST call via Invoke-RestMethod) the .NET DataServiceClient will use Atom/XML under the hood. This works perfectly well except it consumes much more bandwidth because of the XML data format. As the whole ODATA interface is encapsulated via your service reference it really does not make […]
I just came across another nuisance in .NET WebAPI that I want to share with you quickly. In one of our LightSwitch projects we use WebAPI ODATA controller to help out when LightSwitch internal capabilities come to their end. As we are using a PowerShell once in a while as you might already have guessed from our web site we […]
In this post I quickly describe how you can use the select2 plugin with LightSwitch HTML client and present data from ODATA sources via jaydata. LightSwitch has builtin capabilities for selecting related entities via the ‘Modal Data Picker’ control. You can also have drop down or choice lists with static data, however they lack the convenient search and filter mechanisms […]
[UPDATE] 2014-11-28 Jerther sent me a comment (see below) on how he solved this issue! So how did he do it? The short answer is, that you have to include special registration code inside the ‘Application_Start()’ and other places where the order on how you code it plays a crucial role. Check out his post ASP.Net: Web API 2 + […]
When trying to add the current “Microsoft.AspNet.WebApi.OData” to a LightSwitch project I got the following error message: We are not using Silverlight in our application, only the HTML client – except when doing user and role administration … As a matter of fact we only need the package on the server layer anyway. So the solution to this is to […]
This will be a quick post about WebAPI and ODATA controllers, and a strange “bug” or behaviour I found. I was not aware of this, so maybe it is also of some interest for you. When you create an ODATA service via WebAPI and want to connect two or more entity sets via a relation the standard example will tell […]
LightSwitch can consume ODATA data source that you can use to gain more flexibility than using the internal data sources that also generate ODATA REST endpoints. Microsoft Web API provides an easy way on how to generate these endpoints. In this post I quickly describe the steps you need to take to actually create an endpoint that is actually usable […]
Using the built-in RBAC feature of LightSwitch is really cool and easy to use until you have to assign all of your application defined permissions to roles and users. This is usually where the Administration DesktopClient does not scale too well… But of course there is help: and it is especially easy, when you utilize PowerShell to tackle that task. […]
Did you ever get the response from VMware support or anyone else ‘for this you need a CDK license to make it work’? As it turns out this is a costly thing to have and in most cases you will not need it anyway. In addition, if you really come across something the ‘CloudUtil.exe’ does not let you do, you […]
When you play with vCAC workflow and scripts you will most certainly work with the ManagementModelEntitesClient or the MgmtContext for short. Have a look at my introduction to it in this blog post. But there is actually more in vCAC than just that. Out of the box vCAC ships with these models: And some of them are actually quite useful. […]
Calling PowerShell from vCAC is easy, right. But how about the other way round? Suppose you want to start the ‘ReclaimDestroyedStaticIPAddresses’ or the ‘WFStubMachineExpired’ workflow manually? As usual this can be done via the vCAC MetaModel ODATA REST service and of course with PowerShell. For a brief overview about the MetaModel you can have a look at Investigating vCAC 5.2 […]