tjanczuk / edge

Run .NET and Node.js code in-process on Windows, MacOS, and Linux
http://tjanczuk.github.io/edge
Other
5.42k stars 641 forks source link

How to call a constructor with parameters #709

Closed Navakanth009 closed 1 month ago

Navakanth009 commented 4 years ago

Lets say I have class in C# like below

namespace Test { public class Greetings { public Greetings(String greet) { Greet = name; } public async Task Greet() { return String.Format("On {0}, you said {1}", System.DateTime.Now, Greet); } } }

I build this as project and I am trying to access the Greetings.Greet() from .dll like below

let assemblyFile = "./Test.dll" const init = edge.func({ assemblyFile : assemblyFile, typeName: 'Test.Greetings', methodName: 'Greet' });

How to call the Greetings() constructor with parameters here.