Ejemplo n.º 1
0
        public async Task <ActionResult <string> > DeleteAsync(string identificacion)
        {
            var cliente          = _clienteService.Eliminar(identificacion);
            var clienteViewModel = new ClienteViewModel(cliente);
            await _hubContext.Clients.All.SendAsync("ClienteEliminado", clienteViewModel);

            return(Ok(clienteViewModel));
        }
Ejemplo n.º 2
0
        // DELETE: api/Cliente/5
        public GenericResponse <String> Delete(int id)
        {
            GenericResponse <String> response = new GenericResponse <String>();

            try
            {
                servicio.Eliminar(id);
                response = ResponseUtil.CrearRespuestaOk();
            }
            catch (CustomResponseException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw new CustomResponseException(ex.Message, 500);
            }


            return(response);
        }