我有类(Customer),它包含200多个字符串变量作为属性.我正在使用带有键和值参数的方法.我试图从xml文件提供密钥和值.为此,必须使用Customer类的属性(字符串变量)替换值.
即
Customer
{
public string Name{return _name};
public string Address{return _address};
}
CallInput
{
StringTempelate tempelate = new StringTempelate();
foreach(item in items)
tempelate .SetAttribure(item.key, item.Value --> //Say this value is Name, so it has to substitute Customer.Name
}
Run Code Online (Sandbox Code Playgroud)
可能吗?
c# ×1