我试图混淆<条码>AutoMapper,以忽视也拥有<条码>的财产。 Has{PropertyName} nature on the same category, set to false
。
This is for mapping GRPC classes which use optional
in the .proto definition. (I require presence detection, so using wrapper classes won t help me.)
e.g.
syntax = "proto3";
message MyGRPCFoo {
optional int32 bar = 1;
}
然后,在我的C#类别中,在使用变量之前,我会核对<代码>HasBar。
I am aware how to do this per individual member, but I want to achieve it for all members at once.
我尝试了<代码>ShouldMapProperty,但只暴露了PropertyInfo/code>,因此,我无法了解来文方的标语。
I also tried ForAllMembers
, but while it exposes the source object, I did not see how to get the current source property name, only the destination name is exposed. I don t want to rely on the assumption that source and destination names are the same.