Skip to content

Instantly share code, notes, and snippets.

@kppullin
Created March 25, 2013 02:09
Show Gist options
  • Save kppullin/5234495 to your computer and use it in GitHub Desktop.
Save kppullin/5234495 to your computer and use it in GitHub Desktop.
A sample of using dynamic .NET ExpandoObjects with edge.js (https://github.com/tjanczuk/edge)
var edge = require('edge');
var testDynamic = edge.func(function() {/*
//#r "System.Core.dll"
//#r "Microsoft.CSharp.dll"
using System.Dynamic;
using System.Threading.Tasks;
public class Startup
{
public async Task<object> Invoke(object input)
{
dynamic data = new ExpandoObject();
data.FirstName = "kevin";
data.InputFromNode = input;
return data;
}
}
*/});
testDynamic('hello from node', function(err, result) {
console.log(result);
});
/* Result:
[ { Key: 'FirstName', Value: 'kevin' },
{ Key: 'InputFromNode', Value: 'hello from node' } ]
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment