.NET extension methods limitations

Hi there,

Consider the folowing extension method in a .NET library:

public static bool IsBetween<T>(T minor, T major) where T : IComparable<T> 
{
        // ... implementation
}

The extension method allows me to test any number like:

(10).IsBetween(5, 15) 

In the UiPath, the intellisense does not recognize this extension method because it seems not understand that “int” implements “IComparable”.

If I write the same extension method like this way:

public static bool IsBetween(int minor, int major) 
{
        // ... implementation
}

The UiPath recognizes it!

There are any chances to improve UiPath in this subject?

@alexandretperez
In some cases intelisense hangs but in which namespace is this method defined? Is this namespace one of the imported?

From architectural Viewpoint as IT IS a Extension somewhere this needs to be defined. Maybe some additional nuget package hast to be referenced as well.

Yes, I added an additional nuget package that I always use in my .NET projects called Xal.
The extension remains in Xal.Extensions namespace which was also imported but the UiPath does not recognized it.

1 Like

@alexandretperez Hi Alex. Have you already found a solution for this? I’ve got exactly the same issue.

Best regards
Alan

check if the nuget package / extension is referenced by the dependency manager
check if the namespace is imported (imports)
check the xaml - as described here: