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

dotnet mapper ... -p generates code that can't be compiled. #665

Open
jvmlet opened this issue Nov 26, 2023 · 0 comments
Open

dotnet mapper ... -p generates code that can't be compiled. #665

jvmlet opened this issue Nov 26, 2023 · 0 comments

Comments

@jvmlet
Copy link

jvmlet commented Nov 26, 2023

We have POCOs with the same type name in different namespaces.
Adding -p fixes the ambiguous reference, but generates enum mapping like

Mapster.Utils.Enum<x.y.z.E>.Parse(Mapster.Utils.Enum<a.b.c.E>.ToString()),

that fails to compile with error

The type or namespace name 'Utils' does not exist in the namespace 'xxxxxxx'

Same for Mapster.TypeAdapter<T1,T2>

To fix, please render

using Mapster;
using Mapster.Utils;

and non-qualified Enum<SomeType>.Parse()... even if -p is requested.

Thanks

@jvmlet jvmlet changed the title dotnet mapper ... -p generates code that can be compiled. dotnet mapper ... -p generates code that can't be compiled. Nov 26, 2023
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