示例#1
0
        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!"));
        }
示例#2
0
 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());
     }
 }