MapsterMapper / Mapster

A fast, fun and stimulating object to object Mapper
MIT License
4.23k stars 325 forks source link

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

Open jvmlet opened 7 months ago

jvmlet commented 7 months ago

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