示例#1
0
        public ActionResult Create([Bind(Include = "Content")] string Content)
        {
            if (ModelState.IsValid)
            {
                db.Elements.Add(new Element {
                    IdCategory = IdCategory, Content = Content
                });
                db.SaveChanges();
                return(RedirectToAction("Main", "Home"));
            }

            return(View());
        }
 public void AddRelation(Relation relation)
 {
     ElementsBase.Relations.Add(relation);
     ElementsBase.SaveChanges();
 }