【发布时间】:2012-07-17 22:22:13
【问题描述】:
我目前在我的模型中引用 HttpContext。这是好习惯吗?我应该只传递我需要的信息吗?
例如,在我的模型代码中:
public void function()
{
string param = HttpContext.Current.Request.QueryString["param"];
if(param == "myexpectations") { ...}
}
Should be changed to:
public void function(string param) //avoid hard reference this way??
{
if(param == "myexpectations") { ...}
}
【问题讨论】: