【发布时间】:2019-10-15 14:10:31
【问题描述】:
有没有动态选择部分对象属性的方法?
我在 .net Core 3 上,在一个 web api 项目中
我需要根据其值向客户端发送源属性的子集
示例 1:
source = { max="",min="1", label="Code"};
sendToClient obj should be
output = { min="1",label="Code"}
示例 2:
source = { max="35",min="1", label="MixerColor",width="",height="",rounded=null};
sendToClient should be
output = { max="35",min="1",label="Code"}
如果 source[prop] 不是(null 或空)=> 将 source[prop] 发送给客户端
【问题讨论】:
标签: c# .net class asp.net-core reflection