コード例 #1
0
        public async Task <Resultado> Delete(int id)
        {
            await _service.Delete(id);

            return(Notificador.HasNotification() ?
                   Resultado.Failed(Notificador.GetNotifications().Select(x => x.Mensagem).ToArray()) :
                   Resultado.Successfull());
        }
コード例 #2
0
        public IActionResult Delete(int id)
        {
            return(Ok(

                       _DepartamentoService.Delete(id)

                       ));
        }
コード例 #3
0
 public IActionResult Delete(int id)
 {
     try
     {
         var entity = departamentoService.Find(id);
         if (entity == null)
         {
             return(NotFound());
         }
         departamentoService.Delete(entity);
         return(Ok());
     }
     catch (Exception)
     {
         throw;
     }
 }