Esempio n. 1
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Student = await repository.GetSingleAsync(id.Value);

            if (Student != null)
            {
                await repository.DeleteAsync(id.Value);
            }

            return(RedirectToPage("./Index"));
        }
Esempio n. 2
0
        public async Task <ActionResult> Delete(int id)
        {
            await repository.DeleteAsync(id);

            return(Ok());
        }