public ActionResult Edit(Contact contact)
        {
            if (ModelState.IsValid)
            {
                db.Entry(contact).State = EntityState.Modified;
                db.SaveChanges();

                return RedirectToAction("Index");
            }
            return View(contact);
        }
        public ActionResult Create(Contact contact)
        {
            if (ModelState.IsValid)
            {
                db.Contacts.Add(contact);
                db.SaveChanges();

                return RedirectToAction("Index");
            }

            return View(contact);
        }
        public ActionResult Create(Contact contact)
        {
            if (ModelState.IsValid)
            {
                db.Contacts.Add(contact);
                db.SaveChanges();

                // insert these lines to provide
                // notifications to Rhoconnect server
                //RhoconnectNET.Client.notify_on_create(partition(), contact);

                return RedirectToAction("Index");
            }

            return View(contact);
        }
        public ActionResult Update(int id,Contact contact)
        {
            if (ModelState.IsValid)
            {
                Dictionary<string, object> changes=new Dictionary<string,object>();
                changes.Add("id",id);
                if (Request.Params["contact[FirstName]"] != null)
                {
                    changes.Add("FirstName",Request.Params["contact[FirstName]"]);
                }
                if (Request.Params["contact[LastName]"] != null)
                {
                    changes.Add("LastName",Request.Params["contact[LastName]"]);
                }
                if (Request.Params["contact[Phone]"] != null)
                {
                    changes.Add("Phone",Request.Params["contact[Phone]"]);
                }
                if (Request.Params["contact[Email]"] != null)
                {
                    changes.Add("Email",Request.Params["contact[Email]"]);
                }

                return rhoconnect_update(changes, partition());
            }
            return View(contact);
        }
        public ActionResult Insert(Contact contact)
        {
            if (ModelState.IsValid)
            {
                contact = new Contact();
                contact.FirstName = Request.Params["contact[FirstName]"];
                contact.LastName = Request.Params["contact[LastName]"];
                contact.Phone = Request.Params["contact[Phone]"];
                contact.Email = Request.Params["contact[Email]"];

                return rhoconnect_create("{\"FirstName\":\"" + Request.Params["contact[FirstName]"] + "\",\"LastName\":\"" + Request.Params["contact[LastName]"] + "\",\"Phone\":\"" + Request.Params["contact[Phone]"] + "\",\"Email\":\"" + Request.Params["contact[Email]"] + "\"}", partition());
            }
            return View(contact);
        }
        public ActionResult Edit(Contact contact)
        {
            if (ModelState.IsValid)
            {
                db.Entry(contact).State = EntityState.Modified;
                db.SaveChanges();

                // insert this callback to notify Rhoconnect
                // about the update operation
                //RhoconnectNET.Client.notify_on_update(partition(), contact);

                return RedirectToAction("Index");
            }
            return View(contact);
        }