Exemplo n.º 1
0
        public async Task <IActionResult> DeleteBaby([FromRoute] int id)
        {
            var result = await babiesService.DeleteBaby(id);

            if (result == "Error")
            {
                return(NotFound());
            }

            return(Ok());
        }
Exemplo n.º 2
0
        public async Task <ActionResult> OnPostAsync()
        {
            var result = await babiesService.DeleteBaby(Id);

            if (result == "Ok")
            {
                return(RedirectToPage("/Babies/Babies"));
            }

            return(Page());
        }