Example #1
0
        // POST api/values
        public async Task <IHttpActionResult> Post([FromBody] Contact value)
        {
            if (value == null)
            {
                throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.NotFound,
                                                                            "contact can not be null"));
            }

            var result = await _contactRepo.Create(value);

            return(Ok(result));
        }