// [END create] /// <summary> /// Dispays the common form used for the Edit and Create pages. /// </summary> /// <param name="action">The string to display to the user.</param> /// <param name="book">The asp-action value. Where will the form be submitted?</param> /// <returns>An IActionResult that displays the form.</returns> private ActionResult ViewForm(string action, string formAction, Book book = null) { var form = new ViewModels.Books.Form() { Action = action, Book = book ?? new Book(), IsValid = ModelState.IsValid, FormAction = formAction }; return(View("/Views/Books/Form.cshtml", form)); }
/// <summary> /// Dispays the common form used for the Edit and Create pages. /// </summary> /// <param name="action">The string to display to the user.</param> /// <param name="book">The asp-action value. Where will the form be submitted?</param> /// <returns>An IActionResult that displays the form.</returns> private IActionResult ViewForm(string action, string formAction, Book book = null) { var form = new ViewModels.Books.Form() { Action = action, Book = book ?? new Book(), IsValid = ModelState.IsValid, FormAction = formAction }; return View("/Views/Books/Form.cshtml", form); }