public ActionResult Index() { TraininProductViewModel trainingManager = new TraininProductViewModel(); trainingManager.HandleRequest(); return(View(trainingManager)); }
public ActionResult Index(TraininProductViewModel viewModel) { viewModel.IsValid = ModelState.IsValid; viewModel.HandleRequest(); if (viewModel.IsValid) { ModelState.Clear(); } return(View(viewModel)); }