public IEnumerable<Person> GetAllProducts()
 {
     using (var db = new WebApiSampleContext())
     {
         return db.Persons.ToArray();
     }
 }
        // POST api/persons
        public void Post([FromBody]Person value)
        {
            Debug.WriteLine(value);

            using (var db = new WebApiSampleContext())
            {
                db.Persons.Add(value);
                db.SaveChanges();
            }
        }
        public IHttpActionResult GetProduct(string id)
        {
            using (var db = new WebApiSampleContext())
            {
                var query = from p in db.Persons
                            where p.Phone == id
                            select p;

                if (query.Count() == 0)
                {
                    return NotFound();
                }

                return Ok(query.ToArray());
            }
        }
        // DELETE api/persons/5
        public void Delete(string id)
        {
            using (var db = new WebApiSampleContext())
            {
                Person value = (from p in db.Persons
                                where p.Phone == id
                                select p).FirstOrDefault();

                if (value == null)
                {
                    // TODO: Resturn an error.
                    return;
                }

                db.Persons.Remove(value);
                db.SaveChanges();
            }
        }
        // PUT api/persons/5
        public void Put(string id, [FromBody]Person newValue)
        {
            using (var db = new WebApiSampleContext())
            {
                Person value = (from p in db.Persons
                               where p.Phone == id
                               select p).FirstOrDefault();

                if (value == null)
                {
                    // TODO: Resturn an error.
                    return;
                }

                value.Name = newValue.Name;

                db.SaveChanges();
            }
        }