Пример #1
0
        public HttpResponseMessage PostC([FromBody] contacte val)
        {
            var c = ContactesRepository.CreateContacte(val);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, c);

            return(response);
        }
Пример #2
0
        public HttpResponseMessage PostCTot([FromBody] contacte c)
        {
            var contactes = ContactesRepository.GetAllContactes();

            if (contactes == null)
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound));
            }

            c.serializeMail     = true;
            c.serializeTelefons = true;

            var co = ContactesRepository.CreateContacte(c);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, co);

            return(response);
        }