Esempio n. 1
0
 public HttpResponseMessage DeleteOneUserDog([FromBody] DogDetailsView userDog)
 {
     try
     {
         dogValidator     userdogValidator = new dogValidator();
         ValidationResult results          = userdogValidator.Validate(userDog);
         if (results.IsValid)
         {
             Userservice userservice = new Userservice();
             userservice.DeleteDog(userDog);
             return(Request.CreateResponse(HttpStatusCode.OK));
         }
         else
         {
             return(Request.CreateResponse(HttpStatusCode.BadRequest));
         }
     }
     catch (HttpRequestException ex)
     {
         return(Request.CreateResponse(HttpStatusCode.BadRequest));
         // throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.BadRequest,
         //                           badInputValidationException.Result));
         //Request.CreateErrorResponse(HttpStatusCode.NotFound, ex);
     }
 }