internal FoldersModel(Folders folders) { this.Id = folders.Id; this.ParentId = folders.ParentId; this.Title = folders.Title; this.IsList = folders.IsList; }
public ActionResult Add(int? parentId, string title, bool isList) { using (TreeContext context = new TreeContext()) { var newFolders = new Folders() { ParentId = parentId, Title = title, IsList=isList }; context.Folders.Add(newFolders); context.SaveChanges(); } return RedirectToAction("Index"); }