AutoMapper/AutoMapper — Issue #182:  Mapper.DynamicMap causes that target type is stored in cache 
Author: rspacjer
Created: 2012-03-09 14:05:53+00:00
State: open

I have following code:

```cs
public class Unit
{
public string Property { get; set; }
}

public class Person : Unit
{
public string Property2 { get; set; }
public string Property3 { get; set; }
}

public class UnitLightDto
{
public string Property { get; set; }
}

public class PersonLightDto : UnitLightDto
{
public string Property2 { get; set; }
}

public class PersonDto : PersonLightDto
{
public string Property3 { get; set; }
}

public class Tests
{
static Tests()
{
Mapper.CreateMap()
.Include();

Mapper.CreateMap();
}

[Test]
public void Test()
{
var person = new Person();
person.Property2 = "new value";
person.Property3 = "prop 3";

var personDto = Mapper.DynamicMap(person);
Assert.That(personDto, Is.TypeOf());

var personLightDto = Mapper.Map(person);
Assert.That(personLightDto, Is.TypeOf());
}
}
```

which causes that the second test doesn't pass. If I remove usage of Mapper.DynamicMap then the second test pass.