public ActionResult Create(SiteModel sitemodel)
        {
            if (ModelState.IsValid)
            {
                Db.SiteModels.Add(sitemodel);
                Db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(sitemodel);
        }
 public ActionResult Edit(SiteModel sitemodel)
 {
     if (ModelState.IsValid)
     {
         Db.Entry(sitemodel).State = EntityState.Modified;
         Db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(sitemodel);
 }
        public ActionResult Save(SiteModel sitemodel)
        {
            foreach (var item in sitemodel.siteLinks)
            {
                if (Db.SiteLinks.Count(f => f.Id == item.Id) == 0)
                {
                    item.siteModel = Db.SiteModels.Single(f => f.Id == sitemodel.Id);
                    Db.SiteLinks.Add(item);
                    Db.SaveChanges();
                }
                else
                {
                    Db.Entry(item).State = EntityState.Modified;
                    Db.SaveChanges();
                }
            }

            return Content("");
        }