Esempio n. 1
0
        // POST /api/<controller>
        public HttpResponseMessage<Todo> Post(Todo todo)
        {
            _db.Todoes.Add(todo);
            _db.SaveChanges();

            return new HttpResponseMessage<Todo>(HttpStatusCode.Created);
        }
Esempio n. 2
0
 // PUT /api/<controller>/5
 public HttpResponseMessage Put(Todo todo)
 {
     _db.Entry(todo).State = EntityState.Modified;
     _db.SaveChanges();
     return new HttpResponseMessage(HttpStatusCode.NoContent);
 }