コード例 #1
0
        // POST api/values
        public HttpResponseMessage Post(Nail nail)
        {
            int    seed   = (int)DateTime.Now.Ticks;
            Random random = new Random(seed);

            nail.ReferenceId = random.Next();
            _repository.CreateScreenNailer(nail.ReferenceId, nail.Url);

            //Create a new response with an HttpStatusCode of Created 201
            var response = Request.CreateResponse <Nail>(HttpStatusCode.Created, nail);

            return(response);
        }