Insert missing records in a list with LINQ
Looks to me like you should create an Add method to both the OMS_Forecast_Adjustment and OMS_Receipts_Adjustment classes.

you are really adding things to the db all wrong,  you are creating new objects in your code when you don't have to, I think that you really want to add items to a collection variable inside your db object.

it should be an InsertRecord method

this:


    var modelFAF = db.OMS_Forecast_Adjustment;
    foreach (int periodID in missingFAF)
    {
        var modelItem = new OMS_Forecast_Adjustment { PeriodID = periodID, Product = item.Product, SiteID = item.SiteID, Value = 0 };
        modelFAF.Add(modelItem);
    }



Would turn into this

foreach (int periodID in missingFAF)
{
    db.Insert_OMS_Forcase_Adjustment(periodID, item.prodeuct, item.SiteID, 0);
}


so you actually do your insertion inside of a method in the class that you already have.

This removes the creation of 2 extraneous local variables and puts responsibility where it belongs inside of a method in the object that needs to perform the action.

This can be done on both Foreach Loops