示例#1
0
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for
        // more details see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            var updateId = await _reasonService.UpdateReasonAsync(Reason.ReasonId, Reason);

            if (updateId <= 0)
            {
                return(NotFound());
            }

            return(RedirectToPage("./Index"));
        }