1
빈 개체 (예 : 컨트롤러의 클라이언트)를 전달할 때의 이점은 무엇입니까?개체가 비정상적인 상태로 만들어야합니까? 만들기 컨트롤러에서보기로 전달
public ActionResult Create()
{
Client client = new Client();
return View(client);
}
//
// POST: /Client/Create
[HttpPost]
public ActionResult Create(Client clientToAdd)
{
try
{
clientRepository.Insert(clientToAdd);
return RedirectToAction("Index");
반대로 : 객체 (예를 들어, 클라이언트가)는 '건강에 해로운'상태로 생성해야 하는가, 즉 빈 :
public ActionResult Create()
{
return View();
}
//
// POST: /Client/Create
[HttpPost]
public ActionResult Create(Client clientToAdd)
{
try
{
clientRepository.Insert(clientToAdd);
return RedirectToAction("Index");
이유 존재는 무엇입니까?
건배
데이브