我有以下开关案例代码:
public string Channel
{
get
{
switch (OriginCode)
{
case "EMAI":
return "Local Site";
case "TEL":
return "Local Site";
case "WBE":
{
if (CompanyName != null)
{
if (CompanyName.ToUpper().Contains("REMOTE SITE"))
{
return "REMOTE SITE";
}
else if (CompanyName.ToUpper().Contains("FOREIGN CHANNEL"))
{
return "FOREIGN CHANNEL";
}
else
return "OTHER";
}
else return "UNKN";
}
default:
return "UNKN";
}
}
set
{
Channel = value;
}
}
我想使用包含所有映射的配置文件对其进行转换,以便将来可以轻松维护。
你能帮我吗?