// DELETE api/user/5 public bool Delete(long id) { ServiceResponse <User> Response = _userRepository.Delete(id); if (Response.Error) { throw new HttpResponseException(this.Request.CreateErrorResponse(HttpStatusCode.BadRequest, Response.Message)); } return(true); }
public IHttpActionResult DeleteUser(int id) { if (ModelState.IsValid) { try { bl.Delete(id); } catch (Exception) { return(Ok("Error is occured during deleted !")); } return(Ok("Record is deleted Sucessfully !")); } return(Ok()); }