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 VasilePosted May 18, 2020, 5:20 AM
Marius VasilePosted May 18, 2020, 3:44 AM
Piyush PansuriyaPosted May 18, 2020, 2:30 AM
Marius VasilePosted May 18, 2020, 1:30 AM
Piyush PansuriyaPosted May 18, 2020, 1:01 AM