public void EditTreeName(Tree postedTree)
 {
     var tree = db.Trees.Find(postedTree.ID);
     tree.Name = postedTree.Name;
     db.Entry(tree).State = EntityState.Modified;
     db.SaveChanges();
 }
        public TreeEditorViewModel CreateTreeEditorViewModel()
        {
            var tree = new Tree { Name = "" };
            db.Trees.Add(tree);
            db.SaveChanges();

            var treeCreator = new TreeEditorViewModel
            {
                Tree = tree,
                PatientAttributes = db.PatientAttributes.ToList(),
                Nodes = new List<Node>(),
                EquipmentAttributes = db.EquipmentAttributes.ToList(), 
                Equipment = db.Equipment.ToList()
            };
            return treeCreator;
        }