public IActionResult Delete(int IdP) { var TypeAux = TypeList.GetType(IdP); if (TypeAux == null) { return(NotFound()); } if (!TypeList.RemoveType(IdP)) { return(BadRequest()); } return(Ok("Type removed!")); }
public ActionResult <Type> Get(int IdP) { try { var TypeAux = TypeList.GetType(IdP).First(); if (TypeAux == null) { return(BadRequest()); } return(Ok(TypeAux)); } catch (InvalidOperationException) { return(NotFound()); } }