-
Notifications
You must be signed in to change notification settings - Fork 390
Description
I see some discussion on #463, but there was no definitive answer. I defined a TypeAdapterConfig, but the below never gets called:
`
public class TypeContext : SmartEnum
{
public static readonly TypeContext None = new("Undefined", -1);
public static readonly TypeContext Device_DeviceType = new("Device.Type", 1);
public static readonly TypeContext Device_StateType = new ("Device.State", 2);
public static readonly TypeContext Site_SiteType = new ("Site.Type", 3);
public static readonly TypeContext Site_State = new ("Site.State", 4);
public static readonly TypeContext Telemetry_State = new ("Telemetry.State", 6);
public static readonly TypeContext Telemetry_DataType = new ("Telemetry.DataType", 7);
public static readonly TypeContext TelemetryNumericData_State = new ("TelemetryNumericData.State", 8);
public static readonly TypeContext TelemetryTextData_State = new ("TelemetryTextData.State", 9);
public static readonly TypeContext IngestLog_SeverityType = new("IngestLog.SeverityType", 10);
protected TypeContext(string name, int value) : base(name, value) { }
}
`
Then I add the TypeAdapterConfig before calling "Adapt":
TypeAdapterConfig<string, TypeContext>.NewConfig() .Map(d => d, s => TypeContext.FromName(s, true));
The TypeAdapterConfig is not called.