Beispiel #1
0
        public HttpResponseMessage Delete(int id)
        {
            ContactesRepository.DeleteContacte(id);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);

            return(response);
        }
Beispiel #2
0
        public HttpResponseMessage DeleteC(int id)
        {
            var contacte = ContactesRepository.GetContacte(id);

            if (contacte == null)
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound));
            }
            if (ContactesRepository.contacteHasForeign(id))
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }

            ContactesRepository.DeleteContacte(id);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);

            return(response);
        }