A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/MapsterMapper/Mapster/issues/370 below:

Properties that contain capitalized abbreviations cannot also be mapped in the fluent API when mapping to a record · Issue #370 · MapsterMapper/Mapster · GitHub

There are several properties in the Adverse record on the domain model that have abbreviations and are therefore capitalized (e.g. HDMAReasons.) Regardless of the naming strategy Exact, IgnoreCase, Flexible etc.. Mapster will fail execute a custom mapping unless a Pascal case version of the property is passed in for the destination object. Using x => x.HDMAReasons causes the mapper to throw a configuration error saying that there is neither a mapping nor an Ignore for HdmaReasons. Neither object being mapped has that casing. Example of the code that finally worked below.

config.MapDependentTo<Adverse, Domain.Adverse>()
.MapToConstructor(true)
.NameMatchingStrategy(NameMatchingStrategy.IgnoreCase)
.Map("HmdaReasons", src => src.HMDAReasons.Select(x => x.EnumValue))


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4