Example #1
0
        // POST: api/PhoneBook
        public HttpResponseMessage Post([FromBody] DmEntryEx entry)
        {
            if (!string.IsNullOrEmpty(entry.Number) && !string.IsNullOrEmpty(entry.Person))
            {
                var result = _operations.AddEntry(entry);
                if (result == "Success")
                {
                    return(Request.CreateResponse(HttpStatusCode.Created, entry));
                }
            }

            return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Unsuccesfull"));
        }