The syntax you have provided is general C# which you can learn about using external C# education resources. This is not likely something our support can dive into great detail with you. Linq, using Linq and general C# syntax are topics which you can research online if you plan to manually code C# in NinjaScript. If what you are doing is returning a list, you would need to locate the correct way to do what you are trying to achieve in C#. Linq is not NinjaScript topic and would not be something that I can provide in depth support for.
One change you can make to what you provided would be to be specific and not use var. If what you are trying to do does not compile because the return type is not what is expected, it is not the correct syntax for what you are trying to do and you will need to test other ways. For example if the problem was with the var minDistance, changing its declared type to a specific type will generate an error if the return type of the method is different.
[B]double minDistance = [/B]
Please let me know if I may be of further assistance.

Comment