public async Task <IActionResult> OnPost([FromQuery] int year, [FromQuery] int month, [FromQuery] int day, [FromQuery] string slotId, [FromQuery] string id) { if (!ModelState.IsValid) { ErrorMessage = "入力に誤りがあります。"; return(await PageResult(year, month, day, slotId, id)); } var result = await _service.DeleteAppointmentAsync(id); if (!result.Succeeded) { ErrorMessage = result.ErrorMessage; return(await PageResult(year, month, day, slotId, id)); } return(RedirectToPage("SlotDetails", new { year, month, day, id = slotId })); }