We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Add the possibility to explicitly map one enum value to another enum value.
enum CarBrand { Audi, Stellantis } enum CarBrandDto { Audi, FiatChrysler } // declaration [Mapper] public partial DtoMapper { [MapEnum(EnumMappingStrategy.ByName] [MapEnumValue(CarBrand.Stellantis, CarBrandDto.FiatChrysler)] public partial CarBrandDto ToDto(CarBrand brand); } // implementation public partial DtoMapper { public partial CarBrandDto ToDto(CarBrand brand) { return source switch { CarBrand.Audi => CarBrandDto.Audi, CarBrand.Stellantis => CarBrandDto.FiatChrysler, _ => throw new ... }; } }
The text was updated successfully, but these errors were encountered:
ByValue
🎉 This issue has been resolved in version 2.9.0-next.2 🎉
The release is available on:
v2.9.0-next.2
Your semantic-release bot 📦🚀
Sorry, something went wrong.
🎉 This issue has been resolved in version 3.0.0 🎉
v3.0.0
Successfully merging a pull request may close this issue.
Add the possibility to explicitly map one enum value to another enum value.
The text was updated successfully, but these errors were encountered: