Ejemplo n.º 1
0
 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());
 }
Ejemplo n.º 2
0
 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());
 }