// POST: api/ToDoApi
        public IHttpActionResult Post(ToDoItemPostModel value)
        {
            if (!ModelState.IsValid) {
            return BadRequest(ModelState);
             }

             var newItem = new ToDoItem {
            Id = ToDoItems.Max(x => x.Id) + 1,
            Description = value.Description,
            IsComplete = value.IsComplete
             };

             ToDoItems.Add(newItem);

             return CreatedAtRoute(WebApiConfig.ApiControllerAndId, new { id = newItem.Id }, newItem);
        }
        // PUT: api/ToDoApi/5
        public IHttpActionResult Put(ToDoItem value)
        {
            if (!ModelState.IsValid) {
            return BadRequest(ModelState);
             }
             try {

            var existingItem = ToDoItems.SingleOrDefault(x => x.Id == value.Id);
            if (existingItem == null) {
               return NotFound();
            }

            existingItem.IsComplete = value.IsComplete;
            existingItem.Description = value.Description;

            return Ok(existingItem);

             }
             catch {
            return InternalServerError();
             }
        }