我有List<KeyValuePair<string,string>>
2 个元素。1) 键 = AgregateOn 值 = 数量/重量/数量
2)键=最大值/最小值=十进制值(数量/重量)或int(数量)
//我有接口
public interface IQuantityRestriction
{
int? MinQuantity { get; set; }
int? MaxQuantity { get; set; }
decimal? MinAmount { get; set; }
decimal? MaxAmount { get; set; }
decimal? MinWeight { get; set; }
decimal? MaxWeight { get; set; }
}
那么我如何将它从这个映射ConfigurationData(KeyValuePair List)
到IQuantityRestriction
AutoMapper?
for example
<AgregateOn,Quantity> , <Max,5>
应该映射到IQuantityRestriction
属性 MaxQuantity = 5。这可能吗?