/* * public HttpResponseMessage Delete(int id) * { * if (languagesDal.IsThereAnyLanguage(id) == false) * { * return Request.CreateErrorResponse(HttpStatusCode.NotFound, "Kayıt bulunamadı"); * } * * else * { * languagesDal.DeleteLanguage(id); * return Request.CreateResponse(HttpStatusCode.NoContent); * } * * }*/ //aynı işi yapar, kısa yolu public IHttpActionResult Delete(int id) { if (languagesDal.IsThereAnyLanguage(id) == false) { return(NotFound()); } else { languagesDal.DeleteLanguage(id); return(Ok()); } }
public IHttpActionResult Delete(int id) { if (languagesDal.IsThereAnyLanguage(id) == false) { return(NotFound()); //Request.CreateErrorResponse(HttpStatusCode.NotFound, "Kayıt bulunamadı"); } else { languagesDal.DeleteLanguage(id); return(Ok()); //Request.CreateResponse(HttpStatusCode.NoContent); } }