0

I'm using following code to map my classes, and it is working perfectly in one direction, but I want to use same approach to automatically use TwoWays (reverse) mapping, but that is not working using second portion of code:

static string toLower(string s) => s.ToLower();
static string rule(string s) => s.Split("_c_")[^1][1..].Replace("_", "").ToLower();

TypeAdapterConfig.GlobalSettings.Default.NameMatchingStrategy(new NameMatchingStrategy
{
      SourceMemberNameConverter = rule,
      DestinationMemberNameConverter = toLower
});

// Bidirectional mapping
TypeAdapterConfig<T_MOVIMIENTO_RESPONSES, MovementResponse>
  .NewConfig()
  .TwoWays();

0 Answers0