1

Suppose I have two classes and use Mapster to map one to another:

class A 
{
   public int GetX(){ return 1; }
}

class B 
{
   public int X { get; set; }
}

Is any way to globally disable map of GetX() to X for A to B mapping? This behavior is by default, it is described here, but I've not found any way to change it.

trashr0x
  • 6,457
  • 2
  • 29
  • 39
FLCL
  • 2,445
  • 2
  • 24
  • 45
  • A curious case: the mapper tries to map `GetType` method, which is of every object. – FLCL Dec 01 '16 at 07:36

1 Answers1

0

Like accurately described here, mapping strategy can be easily changed with

  TypeAdapterConfig.GlobalSettings.Default.Settings.ValueAccessingStrategies
                .Remove(ValueAccessingStrategy.GetMethod);
FLCL
  • 2,445
  • 2
  • 24
  • 45