I have a c# class that is extending types as follows:
public static class TypeExtensions
{
public static String nameof<TType, TMember>(this TType obj, Expression<Func<TType, TMember>> propertyAccessor)
{
if (propertyAccessor.Body.NodeType == ExpressionType.MemberAccess)
{
var memberExpression = propertyAccessor.Body as MemberExpression;
if (memberExpression == null)
return null;
return memberExpression.Member.Name;
}
return null;
}
}
In C# i would generally access the method like this:
obj.nameof(o => o.PropertyXY)
However, in UiPath Studio I’m not able to extend it. Here's what I've tried
obj.[nameof](Function(o) o.PropertyXY)
I've made sure the namespace is imported correctly.
Am I doing something wrong or is there any known limitation of extending Types in UiPath?
Thanks in advance. Alan
EDIT After properly cleaning the VisualStudio Library-Project (by removing the bin/obj folders) and rebuild, I'm now at least able to see the extension method listed in Intellisense. However, when calling it UiPath complains: "Operation is not valid due to the current state of the object"