Skip to content

AllowImplicitDestinationInheritance(true) Combines all settings, including those that are not recommended for use by child type #947

@bill2004158

Description

@bill2004158

Sample Code:


    public class Animal { }
    public class Dog : Animal { }
    public class Bird : Animal { }


    public class AnimalDto { }
    public class DogDto : AnimalDto { }
    public class BirdDto : AnimalDto { }

    class Program
    {
        static void Main(string[] args)
        {
            var config = new TypeAdapterConfig();
            config.NewConfig<AnimalDto, Animal>().MapWith((s) => s is BirdDto ? new Bird() : new Dog());
            config.AllowImplicitDestinationInheritance = true;

            var d = new DogDto();
            var a = d.Adapt<Dog>(config);
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions