EDGE.js 调用DLL中的多个方法的问题
发布于 8 年前 作者 zhcngh 3669 次浏览 来自 问答

代码我在网上随便找的 c#: using System; using System.Threading.Tasks; namespace Example { public class Greetings { public async Task<object> Greet(object input) { return A();
} private string A(){ return “AAA”; } private string B(){ return “BBB”; } }
}

js代码: var helloWorld = edge.func(function () { async (input) => { return ".NET Welcomes " + input.ToString(); } }); var edgehello = function(req, res) { helloWorld(‘Node, JavaScript, and Express’, function (err, result) { console.log(result); }); };

此时:使用EDGE JS调用c#写的DLL中多个方法时,在EDGEJS中可以调用TASK返回的方法A()的值,如果再想获取方法B()的值,该怎么处理? 难不成要使用DLL中的TASK同时 return {A:A(),B:B()}; ???

回到顶部