Beispiel #1
0
        public IHttpActionResult Put(int id, Language language)
        {
            if (languagesDal.IsThereAnyLanguage(id) == false)
            {
                return(NotFound());
            }

            else if (ModelState.IsValid == false)
            {
                return(BadRequest(ModelState));
            }

            else
            {
                return(Ok(languagesDal.UpdateLanguage(id, language)));
            }
        }
 public IHttpActionResult Put(int id, Languages languages)
 {
     if (languagesDal.IsThereAnyLanguage(id))
     {
         return(NotFound());
         //Request.CreateErrorResponse(HttpStatusCode.NotFound, "Bulunamadı");
     }
     else if (ModelState.IsValid == false)
     {
         return(BadRequest(ModelState));
         //Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
     }
     else
     {
         return(Ok(languagesDal.UpdateLanguage(id, languages)));
         //Request.CreateResponse(HttpStatusCode.OK, languagesDal.UpdateLanguage(id, languages));
     }
 }