public ActionResult Delete(string computername) { if (!ComputerService.Exist(computername)) { return(BadRequest(new { error = "computer with given name does not exist." })); } ComputerService.RemoveComputer(computername); return(Ok()); }
public ActionResult Put(string computername, [FromBody] Computer value) { if (!ComputerService.Exist(computername)) { return(BadRequest(new { error = "computer with the given name does not exist." })); } ComputerService.UpdateComputer(computername, value); return(Ok()); }