Hello Community
I am very new to use dot Net in MS Dynamics NAV, and I am still at the begining.
So I want to use Dot Net to check if any file exists in a directory (I know you can do this with C/AL too, but I would like to use the dot Net method)
So my C# code looks like this:
bool isEmpty = !Directory.EnumerateFiles(path).Any();
In MS Dynamics NAV 2017 I declared a Local Dot Net Variable called DirectoryL with subtype System.IO.Directory.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
I wrote this code:
IsEmpty := DirectoryL.EnumerateFiles(DirectoryPathP).Any();
And I get the Error message "You have specified an unkown Variable: any"
I know that the any functions is from the System.Linq.Enumerable.'System.Core but how do I combine functions of two dot net classes in one statment?
So my question is how do I use this C# statment in dynamics NAV?
Thanks for your suggestions.
Regards Joshua
*This post is locked for comments