-
Notifications
You must be signed in to change notification settings - Fork 372
Open
Labels
Description
If you use IRegister to define the inheritance mapping like this:
DerivedPocoProfile.cs
public class DerivedPocoProfile : IRegister
{
public void Register(TypeAdapterConfig config)
{
.NewConfig<DerivedPoco, DerivedDto>()
.Inherits<SimplePoco, SimpleDto>();
}
}
SimplePocoProfile.cs
public class SimplePocoProfile : IRegister
{
public void Register(TypeAdapterConfig config)
{
.NewConfig<SimplePoco, SimpleDto>();
}
}
and then use scan assembly for types:
TypeAdapterConfig.GlobalSettings.Scan(typeof(DerivedPocoProfile).Assembly);
there is no guarantee that the base type will be registered first and
.Inherits<SimplePoco, SimpleDto>();
will fail silently, leaving your mapping inconsistent.
The current implementation of Inherits
does nothing and simply returns when the type tuple has not yet been registered.
praschl and MuTsunTsai