예제 #1
0
 public IHttpActionResult Post(Languages language)
 {
     if (ModelState.IsValid)
     {
         var _language = languageDAL.CreateLanguage(language);
         //Request.CreateResponse(HttpStatusCode.OK, _language);
         return(CreatedAtRoute("DefaultApi", new { id = _language.Id }, _language));
     }
     else
     {
         //return Request.CreateResponse(HttpStatusCode.BadRequest, ModelState);
         return(BadRequest(ModelState));
     }
 }