public async Task <IActionResult> Create([Bind("TodoNodeId,Title,Description")] TodoNode todoNode) { if (ModelState.IsValid) { _context.Add(todoNode); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(todoNode)); }
public async Task <IActionResult> Create([Bind("TodoNodeParentMapId,TodoNodeId,ParentNodeId")] TodoNodeParentMap todoNodeParentMap) { if (ModelState.IsValid) { _context.Add(todoNodeParentMap); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewData["ParentNodeId"] = new SelectList(_context.TodoNode, "TodoNodeId", "Title", todoNodeParentMap.ParentNodeId); ViewData["TodoNodeId"] = new SelectList(_context.TodoNode, "TodoNodeId", "Title", todoNodeParentMap.TodoNodeId); return(View(todoNodeParentMap)); }