public async Task <IActionResult> Create([Bind("Id,Title,Latitude,Longitude")] RiskAssessment riskAssessment) { if (ModelState.IsValid) { _context.Add(riskAssessment); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(riskAssessment)); }
public async Task <IActionResult> Create([Bind("Id,Title,Level,RiskAssessmentId")] Threat threat) { if (ModelState.IsValid) { _context.Add(threat); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["RiskAssessmentId"] = new SelectList(_context.RiskAssessments, "Id", "Id", threat.RiskAssessmentId); return(View(threat)); }