我使用的是 ValueInjecter 而不是 AutoMapper。我正在尝试使用
.InjectFrom<UnflatLoopValueInjection>(model)
Run Code Online (Sandbox Code Playgroud)
它有效,但我还想指定一些在 unflattening 操作期间要忽略的属性,例如编写如下内容:
.InjectFrom<UnflatLoopValueInjection>(new IgnoreProperties("Prop1", "Prop2"), model)
Run Code Online (Sandbox Code Playgroud)
或者
.InjectFrom<UnflatLoopValueInjection>(model).IgnoreProperties("Prop1", "Prop2")
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?