2
HP強化掃描爲我提供了一條消息,內容爲重量分配:對我控制器中大多數操作方法的不安全粘合劑配置(API濫用,結構)。以下是操作方法的示例。HP Fortify - Mass assignment
<HttpPost>
Function Edit(model as GridViewModel)
Dim manager as new Managers
manager.Edit(model.id, model.name, model.desc,model.class)
Return Nothing
End Function
當我嘗試下面的方法時,錯誤消失了。
<HttpPost>
Function Edit(id as integer?,name as string, desc as string, class as string)
Dim manager as new Managers
manager.Edit(id, name, desc,class)
Return Nothing
End Function
但上面的代碼似乎是MVC的不良做法。 請建議一種方法來解決這個問題。