public ActionResult Delete(string id) { if (manager.DeleteServer(id)) { return(Ok()); } // if the server was not found return(NotFound("Server wasn't found")); }
public ActionResult Delete(string id) { bool succeed = serverManager.DeleteServer(id); if (!succeed) { return(NotFound(succeed)); } return(Ok(succeed)); }
public ActionResult Delete(string id) { string urlRequest = Request.Path; string correctPattern = @"^/api/Server/[a-zA-Z]{2}[0-9]{5}[a-zA-Z]{3}$"; if (!Regex.IsMatch(urlRequest, correctPattern)) { return(BadRequest()); } bool succeed = serverManager.DeleteServer(id); if (!succeed) { return(NotFound(succeed)); } return(Ok(succeed)); }
public void Delete(string id) { serversManager.DeleteServer(id); }