请教一个问题,如果是 Expression<func<T,T>>
这样的表达式如何动态创建,
比如:Expression<Func<Customer, Customer>> exp = a => new Customer { name = "" };
想要根据条件动态赋值字段属性,结果类似这样:
if(addrParam!="")
exp= a => new Customer { name = "",addr = addrParam};
if(telParam!="")
exp= a => new Customer { name = "",addr = "",tel = telParam };
不是这种表达式:Expression<func<T,bool>>
。
希望帮忙解答,谢谢!