Beispiel #1
0
        public async Task <IActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(RedirectToAction(nameof(Error), new { message = "Id not provided" }));
            }

            var obj = await _people.FindByIdAsync(id.Value);

            if (obj == null)
            {
                return(RedirectToAction(nameof(Error), new { message = "Id not found" }));
            }

            return(View(obj));
        }