I'm getting an error:
SystemArguementNullException: 'Value cannot be null. Parameter name: entity'
When I leave off the AR_Reliability section the main other data columns are inserted without error.
public bool AddReport(Forms_Reports report)
{
ctx.Forms_Reports.Add(report);
ctx.SaveChanges();
return true;
}
My JSON body looks like this:
[
{
"AR_Reliability":[
{
"Process_Consequence_Analysis":"Test_Pc HSS",
"Reliability_Parameter_Deviations":"Test_Rp",
"Equipment_Out_Of_Service":"Test_Eos",
"Equipment_Returned_to_Service":"Test_Er",
"Critical_Instrumentation_Failure":"Test_Ci",
"Total_Equipment_Failure":"Test_Te",
"Total_Single_Point_of_Failure":"Test_Spf",
"Maintainence_Scheduled_or_InProgress":"Test_Mc",
"Active_Permits":"Test_Ap",
"Issues":"Test_I",
"Inventory_Tank_Levels":"Test_It",
"Stream_ID":null,
"SPF_ID":null,
"Ins_ID":null,
"Eqp_ID":null,
"DE_ID":1
}
],
"RoadClosures":"Test_Rc",
"FirstMaintainStart":"Test_Fms",
"PSR_AbnormalOperations":"Test_Ao",
"FeedstockChanges":"Test_Fsc",
"LineupChanges":"Test_Lc",
"SafetyMeetings":"Test_Sm ",
"CR_AbnormalOperations":"Test_Ao",
"HighPriorityAlarms":"Test_Hpa",
"Impairment_to_fire_protection_systems":"Test_Ifp",
"AlarmsInhibited":"Test_Ai",
"FR_AbnormalOperations":"Test_Ao",
"Maintenance":"Test_Mt ",
"CreatedDate":"2019-01-08T00:00:00",
"UpdatedDate":"2019-01-08T00:00:00",
"CreatedBy":"Dev HSS ",
"UpdatedBy":"Dev HSS ",
"Shift":"1 ",
"Area_ID":1,
"User_ID":1
}
]
AR_Reliability is a related table in the database - There are other related tables too but just trying to add data for this one table to my Entity.