Created
March 25, 2013 02:09
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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