tjanczuk / edge

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

How to call a constructor with parameters #709

Open Navakanth009 opened 3 years ago

Navakanth009 commented 3 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.