public IActionResult OnPost([FromServices] AddCustomerInformation addCustomerInformation) { if (!ModelState.IsValid) { return(Page()); } addCustomerInformation.Do(CustomerInformation); return(RedirectToPage("/Checkout/Payment")); }
public IActionResult AddCustomerInformation( AddCustomerInformation.Request customerInformation, [FromServices] AddCustomerInformation addCustomerInformation) { if (ModelState.IsValid) { addCustomerInformation.Do(customerInformation); return(Ok()); } return(BadRequest()); }