I want to insert 3 value of radio button into Database using MVC. User need to select one material for each categories(Walls,Roof,Floor)
Currently the user can only select one value (may need to do grouping).But when I do grouping only the structInfo value is inserted into database. I need all the 3 value inserted into database.
This is how the database design look like

the struct inf(walls,roof,floor) the materialinfo is (bricks.concrete,woods, etc)
So can I make all the 3 value choosed by user save into database?
This is my view
@foreach (var structIN in Model.structInfo)
{
if (structIN.structId.Equals(1))
{
@Html.Label(structIN.structNm) @:
foreach (var material in Model.materialInfo)
{
if (material.materialId.Equals(1) || material.materialId.Equals(2) || material.materialId.Equals(3))
{
@Html.RadioButtonFor(model => model.buildInfo.materialId, material.materialId)@Html.Label(material.materialNm)
@Html.HiddenFor(model => model.buildInfo.structId, new { Value = structIN.structId })
}
}
}
else if(structIN.structId.Equals(2))
{
<br />
@Html.Label(structIN.structNm) @:
foreach (var material2 in Model.materialInfo)
{
if (material2.materialId.Equals(2) || material2.materialId.Equals(4) || material2.materialId.Equals(5))
{
@Html.RadioButtonFor(model2 => model2.buildInfo.materialId, material2.materialId)@Html.Label(material2.materialNm)
@Html.HiddenFor(model2 => model2.buildInfo.structId, new { Value = structIN.structId })
}
}
}
else if (structIN.structId.Equals(3))
{
<br />
@Html.Label(structIN.structNm) @:
foreach (var material3 in Model.materialInfo)
{
if (material3.materialId.Equals(6) || material3.materialId.Equals(3))
{
@Html.RadioButtonFor(model3 => model3.buildInfo.materialId, material3.materialId) @Html.Label(material3.materialNm)
@Html.HiddenFor(model3 => model3.buildInfo.structId, new { Value = structIN.structId })
}
}
}
}

my GET method
Populating Data
In View
My POST method
I am always getting this error
System.NullReferenceException: Object reference not set to an instance of an object.
How the proper code should look like? Thank you.