public ActionResult Delete(int id)
 {
     try
     {
         _senhasService.Delete(id);
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(PartialView());
     }
 }
Esempio n. 2
0
        public async Task <ActionResult <TblSenhas> > Delete([FromRoute] int id)
        {
            if (id == 0)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                return(Ok(await _service.Delete(id)));
            }
            catch (Exception exception)
            {
                return(BadRequest(exception));
            }
        }