我正在研究一個asp.net mvc應用程序。如何在asp.net中調用控制器中的模型方法mvc
這是我通過應用程序正確的方法。
這裏是我的模型:
public class EmployeeModel
{
//Properties
// Constructors
// Methods
}
筆者認爲:(強烈模特屬性類型)例如:有些編輯查看
我的控制器:
[httppost]
public void save(Employeemodel m) // ajax call that gets updated model details
{
m.update() // making database call from controller action
}
是否有任何嚴重的設計問題用我的MVC方法。可能我誤解了MVC?
是否適合在控制器操作中調用模型方法(m.update())?
模型包含操縱數據的方法嗎?這是對的嗎?
請幫助/建議正確的做法在MVC
寫裏面的方法'EmployeeModel'它會叫... –