TL&DR: Several concurrent Tasks trying to place identical records into a database; Essentially SEVERAL tasks are being spun up and opening up several files that could be identical.
It is vital to save all the information, in a heavily nested table, based on the IP Address; Here is what I have tried so far in the last 4 days of work (even during Christmas!)
Each of the Objects increments, during insert. This is why this doesn't make sense. I am at at a loss of words.
IP has many Incidents;
I think you might have a problem in these lines:
Vendor vendorInstancer = new Vendor(); vendorInstance.IncidentID = IncidentId; context.Vendors.Add(vendorInstancer);
Note the variable names. You create
vendorInstancer but update ID of the
vendorInstance. That is, not the entity you're saving to the database. Hard to spot that one letter difference.