public void Delete(int id) { try { repository.Delete(id); } catch (Exception ex) { throw new Exception(ex.Message); } }
public void Delete(SucursalDTO entity) { try { Sucursal sucursal = Mapper.Map <Sucursal>(entity); _sucursalRepository.Delete(sucursal); } catch (Exception ex) { throw ex; } }
public HttpResponseMessage Delete(int id) { HttpResponseMessage response = new HttpResponseMessage(); try { response.StatusCode = HttpStatusCode.OK; _repository.Delete(id); return(response); } catch (Exception e) { response.StatusCode = HttpStatusCode.InternalServerError; response.ReasonPhrase = e.Message; return(response); } }