示例#1
0
        public HttpResponseMessage GetTot()
        {
            var contactes = ContactesRepository.GetAllContactes();
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, contactes);

            return(response);
        }
示例#2
0
        public HttpResponseMessage Get()
        {
            var contactes = ContactesRepository.GetAllContactes();

            foreach (var c in contactes)
            {
                c.serializarEmail   = false;
                c.serializarTelefon = false;
            }
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, contactes);

            return(response);
        }
示例#3
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);
        }
示例#4
0
        public HttpResponseMessage GetTot()
        {
            var contactes = ContactesRepository.GetAllContactes();

            if (contactes == null)
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound));
            }
            foreach (var c in contactes)
            {
                c.serializeMail     = true;
                c.serializeTelefons = true;
            }

            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, contactes);

            return(response);
        }