public async Task <IActionResult> Create([Bind("HeldId,HeldName,HeldEigenschaft")] Held held) { if (ModelState.IsValid) { _context.Add(held); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(held)); }
public async Task <IActionResult> Create([Bind("AgressorId,AgressorName,AgressorEigenschaft")] Agressor agressor) { if (ModelState.IsValid) { _context.Add(agressor); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(agressor)); }
public async Task <IActionResult> Create([Bind("BedrohungId,HeldId,AgressorId,Bedrohungsbezeichnung")] Bedrohung bedrohung) { if (ModelState.IsValid) { _context.Add(bedrohung); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["AgressorId"] = new SelectList(_context.Agressors, "AgressorId", "AgressorEigenschaft", bedrohung.AgressorId); ViewData["HeldId"] = new SelectList(_context.Helds, "HeldId", "HeldEigenschaft", bedrohung.HeldId); return(View(bedrohung)); }