Ignore:
Timestamp:
09/20/21 17:20:22 (8 months ago)
Author:
dpiringe
Message:

#3026

  • fixed a bug with dynamic casting in EnumTypeConverter
  • reworked RegressionProblemDataConverter
    • the target type is now: ValueParameter<IRegressionProblemData>
    • removed all dynamic/reflection code
    • reduced a lot of complexity
    • now it works with different variables (the Variable symbol bug should be fixed)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/EnumTypeConverter.cs

    r18043 r18057  
    1212      (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(EnumValue<>));
    1313
    14     public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) =>
    15       ((dynamic)item).Value = Enum.Parse(
    16         item.GetType().GenericTypeArguments.First(), 
     14    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
     15      ((dynamic)item).Value = (dynamic)Enum.Parse(
     16        item.GetType().GenericTypeArguments.First(),
    1717        ((StringJsonItem)data).Value);
     18    }
     19     
    1820   
    1921    public override IJsonItem Extract(IItem value, IJsonItemConverter root) {
Note: See TracChangeset for help on using the changeset viewer.