public Response DeleteByID(long id) { Response response = new Response(); try { Processor.Delete(id); response.Text = $"Entity with id {id} was successfully removed from the system."; response.Result = true; } catch { response.Text = "Unfortunately something went wrong. Are you sure the entity you are trying to delete exists ?"; response.Result = false; } return(response); }
/// <summary> /// Function to delete entities . /// </summary> /// <param name="idList">entities id</param> /// <returns>response</returns> public ApiResponse Delete(List <long> idList) { ApiResponse response = new ApiResponse(); try { Processor.Delete(idList); response.Text = "The entity was successfully removed . \n"; response.Result = true; return(response); } catch (Exception ex) { response.Result = false; response.Text = ex.Message; return(response); } }
public ApiResponse DeleteById(long id) { UserProcessor = new UserProcessor(); Response = new ApiResponse(); try { UserProcessor.Delete(id); Response.text = "Entity was successfully removed from the system."; Response.result = true; return(Response); } catch { Response.text = "Unfortunately something went wrong :("; Response.result = false; return(Response); } }
public ApiResponse Delete(List <long> idList) { UserProcessor = new UserProcessor(); Response = new ApiResponse(); try { UserProcessor.Delete(idList); Response.text = "Entity was successfully removed from the system."; Response.result = true; return(Response); } catch { Response.text = "Unfortunately something went wrong. Try again later. :)"; Response.result = false; return(Response); } }
public void Delete(int id) { userProcessor.Delete(id); }
public void DeleteUser(long id) { userProcessor.Delete(id); }