c# - How to Integrate NodeJs in Existing .Net MVC application Using EdgeJs? -
c# - How to Integrate NodeJs in Existing .Net MVC application Using EdgeJs? -
can 1 suggest way integrate nodejs in .net mvc application? using next code:
public class startup { public async task<object> invoke(dynamic input) { departmentrep person = new departmentrep(new mvcappusingedgejsmongodbcontext()); var department= person.getalldepartments(); //var section = "hello"; homecoming department; } } public class departmentcontroller : controller { departmentrepository departmentrepository = new departmentrepository(new mvcappusingedgejsmongodbcontext()); string connectionstring = configurationmanager.appsettings["connectionstring"].tostring(); public viewresult index() { // var clrmethod = edge.func("departmentrep.cs"); var getdata = edge.func("./departmentrep.dll"); // homecoming view(clrmethod); homecoming view(departmentrepository.getalldepartments()); } }
it seems me, may have misunderstanding of edgejs utilize case. startup/invoke class/signature meant called node(javascript), , code showing looks loading .net .net
also , invoke signature suggest, should asynchronous.
if want utilize node .net side. should check project documentation scripting-nodejs-from-clr downwards.
var func = edge.func(@" homecoming function (data, callback) { callback(null, 'node.js welcomes ' + data); } ");
as can see there wrapped code javascript, time running in .net more running in node. perfect utilize case immo socket-server, is, node improve .net (immo again)
which in perfect contrast .net ado sql server access nodejs, .net specialization nodejs context
c# asp.net-mvc node.js
Comments
Post a Comment