Skip to content

Tag: ODATA

LightSwitch 0

Using LightSwitch with EntityFramework 6 and CodeFirst based ODATA Controllers

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 […]

LightSwitch 3

A simple ODATA v3 Controller for ActiveDirectory search operations

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 […]

PowerShell 1

[NoBrainer] More Fun with ODATA Actions in PowerShell

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 […]

PowerShell 1

[NoBrainer] Using ODATA Actions via PowerShell

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 […]

LightSwitch 3

[NoBrainer] Saving bandwidth with JSON when consuming ODATA services from PowerShell

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 […]

LightSwitch 2

WebAPI and “The response to this POST request did not contain a ‘location’ header. That is not supported by this client.”

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 […]

LightSwitch 2

[NoBrainer] Using JayData with jQuery select2 plugin in LightSwitch HTML

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 […]

LightSwitch 0

Microsoft.AspNet.WebApi.Client 5.2.0 not compatible with LightSwitch Silverlight Client

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 […]

PowerShell 0

Getting most out of vCAC without a CDK license

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 […]

PowerShell 2

Investigating vCAC 5.2 Models

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. […]

PowerShell 0

Running a vCAC Workflow from PowerShell

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 […]