Skip to content

Mapster.Tool: Mapper code is not generated when source type is a generic #605

Description

@rafalka

Mapster.Tool does not generate mapper class when source type is a generic

Example

Types definition:

public enum TypeEnum { A, B, C }

public class Src<T> where T:Enum
{
    public int IntVal { get; set; }
    public T Type { get; set; }
}

public class Dst<T> where T:Enum
{
    public int IntVal { get; set; }
    public T Type { get; set; }
}

Mapper configuration:

        public void Register(TypeAdapterConfig config)
        {
            config.NewConfig<Src<TypeEnum>, Dst<TypeEnum>>()
                .GenerateMapper(MapType.Map);
        }

Sample project:

MapsterBug-CodeNotGeneratedForGeneric.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions