[HttpDelete("eliminar/{id:int}")] // Metodo DELETE para eliminar elemento public IActionResult Delete(int id) { var clientMachine = _clientMachineRepository.Delete(id, HttpContext.User.Identity.Name); // Eliminar elemento var clientMachineDto = _mapper.Map <ClientMachineDto>(clientMachine); // Mapear entitidad a dto return(Ok(clientMachineDto)); }
public IActionResult Delete([FromQuery] long[] ids) { try { if (ids.Length == 0) { return new ResponseResult(Response) { StatusCode = (int)StatusCodes.Status400BadRequest, ErrorMessage = "Deleting failed. No record was selected" } } .ToJsonResult(); repository.Delete(ids); return(Ok($"Successfully Deleted {ids.Length} records.")); }