Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when leves proertiy is same name,its exception #706

Open
baij45 opened this issue May 13, 2024 · 0 comments
Open

when leves proertiy is same name,its exception #706

baij45 opened this issue May 13, 2024 · 0 comments

Comments

@baij45
Copy link

baij45 commented May 13, 2024

public class User
{
    public string name { set; get; }
}

publicclass Bai
{
    public string code { get; set; }
}

publicclass People
{
    public Bai name { get; set; }
}

    User user = new User();
    user.name = "bai";
    TypeAdapterConfig<User, People>.NewConfig().Map(dest => dest.name.code, src => src.name);

    People p = user.Adapt<People>();

System.InvalidCastException:“From“System.String”To“DXApplicationTest.dto.Bai”Invalid cast。”
it is same name with User.name and People.name,but it is not same class。how to fix this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant