I don't understand why the table adds only one value and it doesn't add the second one. For the HazardClass is working fine but for HazardDetails is not
Update. It seems that the problem I have is with:
- class="form-control">
- @Html.DisplayFor(model => model.HazardClass.IdHC)
- var emptyHaz = new HazardDetail();
- if (await TryUpdateModelAsync
(emptyHaz, "hazardDetail", s => s.IdHC, s => s.HazDetail)) - {
- _context.HazardDetails.Add(emptyHaz);
- await _context.SaveChangesAsync();
- return RedirectToPage("./Index");
- }


Marius VasileRank #785 · 2.9K reputationPosted May 17, 2020, 9:30 PM EDT
Piyush PansuriyaRank #454 · 5.5K reputationPosted May 17, 2020, 10:30 PM EDT
Marius VasileRank #785 · 2.9K reputationPosted May 17, 2020, 11:44 PM EDT
Marius VasileRank #785 · 2.9K reputationPosted May 18, 2020, 1:20 AM EDT
Piyush PansuriyaRank #454 · 5.5K reputationPosted May 17, 2020, 9:01 PM EDT