'Mapster. How to get specific member configuration?
I need to find source member (and its value) by destination name. As a workaround i could create temporary model object but obviously this is undesirable approach 😅
Example using AutoMapper
// validation omitted for brevity
var map = this._mapper.ConfigurationProvider.FindTypeMapFor<TDto, TModel>();
var dtoPrimaryKey = modelPrimaryKey.Properties
.Select(x => map.GetPropertyMapByDestinationProperty(x.Name))
.Select(x => x.SourceMembers.First().GetMemberValue(dto))
.ToArray();
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
