-
Notifications
You must be signed in to change notification settings - Fork 103
Description
When using the description method in numl the Descriptor object throws an exception when a Feature or Label attribute is defined on a complex type property. Properties can be complex types from external libraries thus preventing numl attribute usage.
For example given the below type:
public class Foo
{
[Feature]
public Bar One { get; set; }
[Label]
public bool IsOK { get; set; }
}
public class Bar
{
public int A { get; set; }
public int B { get; set; }
public int C { get; set; }
}
The descriptor would throw an error on converting the type Bar to a double. This is the same for nullable type properties also.
A suggested implementation is to use property path(s) in the Feature attribute. This would allow the Descriptor to extract one or more sub properties from the complex type.
Suggested Implementation:
public class Foo
{
[FeatureSelector("Bar.A", Bar.B", "Bar.C")]
public Bar One { get; set; }
[Label]
public bool IsOK { get; set; }
}