Hi all,
I'd like to know if there is an easy way to map .NET delegates on X++. I know that X++ delegates don't return a value so this is not a viable use, but since they can be (and are) marshaled on .NET classes and used on X++ (though IL code) I'd like to know if somebody could show me an example.
More specifically I am trying to use tasks like the example below...
Task<int> task1 = new Task<int>(() =>
{
int result = 1;
for (int i = 1; i < 10; i++)
result *= i;
return result;
});
Anyway think this last code would be encapsulated on .NET code and what I must pass to .NET would be the X++ code.So that would be something like:
MyClassOnDotNetInteroped.PassADelegateFromXPlusPlus(MyDelegateOrHandlerOnXPlusPlus);
private int MyDelegateOrHandlerOnXPlusPlus()
{
}
How this could be achieved through X++?
Thanks and hope I explained properly my problem.
*This post is locked for comments
I have the same question (0)