Skip to content
Loading
ASP.NET Core EF set @html as input source 
0
  • Marius Vasile
    Well I just follow example from Microsoft, anyway, you have the post code, please write down the code as you see it and I will try. Thank you
    0
  • Piyush Pansuriya
    Hi, when you are adding single object you can write .Add(obj)
    But when you are adding list of objects you have to write .AddRange(list).
    0
  • Marius Vasile
    I am not sure I understand very well, please be more specific. To be clear, I have two tables, HazardClass and HazardDetail. When I add data to HazardDetail, I get the Id and Class from HazardClass and then add new HazardDetail. When I save, Id is not written in the table
    0
  • Piyush Pansuriya
    Hi, onPost you have to declare the variable of HazardDetail as list
    1. list  listHaz = new list(); 
     
    and you have to save range of the detail like
    1. _context.HazardDetails.AddRange(listHaz); 
     
    -1