public IActionResult ManualParsingInSeparateActionsPOST() { OperationsModel OM = new OperationsModel(); OM.value1 = Int16.Parse(Request.Form["value1"]); OM.value2 = Int16.Parse(Request.Form["value2"]); OM.operation = Request.Form["operation"]; OM.compute(); return(View("Result", OM)); }
public IActionResult ModelBindingInParameters(int value1, int value2, string operation) { if (Request.Method.Equals("POST", StringComparison.OrdinalIgnoreCase)) { OperationsModel OM = new OperationsModel(); OM.value1 = value1; OM.value2 = value2; OM.operation = operation; OM.compute(); return(View("Result", OM)); } else { return(View()); } }
public IActionResult ManualParsingInSingleAction() { if (Request.Method.Equals("POST", StringComparison.OrdinalIgnoreCase)) { OperationsModel OM = new OperationsModel(); OM.value1 = Int32.Parse(Request.Form["value1"]); OM.value2 = Int16.Parse(Request.Form["value2"]); OM.operation = Request.Form["operation"]; OM.compute(); return(View("Result", OM)); } else { return(View()); } }
public IActionResult ModelBindingInSeparateModel(OperationsModel OM) { OM.compute(); return(View("Result", OM)); }