Пример #1
0
 public string Get(string path)
 {
     using (SiteEntitites ctx = new SiteEntitites())
     {
         return ctx.Sites.FirstOrDefault(s => s.Name == path).Text;
     }
 }
Пример #2
0
 public ActionResult Page(string page)
 {
     using (SiteEntitites ctx = new SiteEntitites())
     {
         ViewBag.Header = page;
         ViewBag.Information = ctx.Sites.First(s => s.Name == page).Text;
         return View();
     }
 }
Пример #3
0
        public bool Update(string path, string text)
        {
            using (SiteEntitites ctx = new SiteEntitites())
            {
                Site subSite = ctx.Sites.First(s => s.Name ==path);
                if (subSite != null)
                {
                    subSite.Text = text;
                }
                ctx.SaveChanges();

                return true;
            }
        }